question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'Access-Control-Allow-Origin' header contains multiple values '*, *', but only one is allowed

See original GitHub issue

I am using django-cors-headers and I have deployed my application on server, but still I am getting this issue. My current setting for CORS are

INSTALLED_APPS = ['corsheaders']

MIDDLEWARE_CLASSES = ['corsheaders.middleware.CorsMiddleware', 'corsheaders.middleware.CorsPostCsrfMiddleware']

CORS_ORIGIN_ALLOW_ALL = True

CORS_REPLACE_HTTPS_REFERER = True


CORS_ALLOW_HEADERS = (
        'x-requested-with',
        'content-type',
        'accept',
        'origin',
        'authorization',
        'x-csrftoken',
        'accept-encoding'
    )

CORS_ALLOW_METHODS = (
        'GET',
        'POST',
        'PUT',
        'PATCH',
        'DELETE',
        'OPTIONS'
    )

is there anyone who has resolved the following issue

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8

github_iconTop GitHub Comments

15reactions
ambientsoundcommented, Jun 7, 2016

Removing add_header Access-Control-Allow-Origin *; from my nginx configuration solved this problem.

11reactions
agriffiscommented, Jun 30, 2016

This happens when there are multiple layers in the server stack setting CORS headers. You just need to decide if you’re going to set the headers with django-cors-headers or using another layer (such as nginx), not both.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The 'Access-Control-Allow-Origin' header contains multiple ...
The 'Access-Control-Allow-Origin' header contains multiple values 'http://127.0.0.1:9000, http://127.0.0.1:9000', but only one is allowed.
Read more >
Solved: CORS Error : header contains multiple values
Hi All, I am getting "The 'Access-Control-Allow-Origin' header contains multiple values '*, *', but only one is allowed." type of error when requesting...
Read more >
The 'Access-Control-Allow-Origin' header contains multiple ...
The 'Access-Control-Allow-Origin' header contains multiple values, but only one is allowed. ... When defining multiple domains separated by coma ...
Read more >
The 'Access-Control-Allow-Origin' header contains multiple ...
... website hosted on Plesk for Linux server: The 'Access-Control-Allow-Origin' header contains multiple values, but only one is allowed.
Read more >
The 'Access-Control-Allow-Origin ... - Jitsi Community Forum
The 'Access-Control-Allow-Origin' header contains multiple values ... contains multiple values i.e domain name , *, but only one is allowed.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found