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.

Firefox does not support CORS redirects

See original GitHub issue

My architecture is composed by a frontend html+js in one container: this container contains all contents in your folder; a nginx container as load balancer (on port 9200); N VM as CDN (on port 9500).

This is nginx load balancer config file:

upstream cdn-audio {
        server 192.168.99.103:9500;
        server 192.168.99.104:9500;
        server 192.168.99.105:9500;
   }

upstream cdn-video {
        server 192.168.99.103:9500;
        server 192.168.99.104:9500;
        server 192.168.99.105:9500;
    }


server {

listen 80;
server_name 172.17.0.1;
access_log /var/log/nginx/acces.log main;

location = /LynyrdSkynyrdFreebirdAudio.mp4 {

             proxy_pass http://cdn-video/LynyrdSkynyrdFreebirdAudio.mp4;
#           proxy_pass http://192.168.99.103:9500;
#           return 301 $scheme://cdn-audio/LynyrdSkynyrdFreebirdAudio.mp4;
            add_header X-Upstream  $upstream_addr;

        }

       location = /LynyrdSkynyrdFreebirdVideo.mp4 {
             proxy_pass http://cdn-video/LynyrdSkynyrdFreebirdVideo.mp4;
#             proxy_pass http://192.168.99.103:9500;
#             return 301 $scheme://cdn-audio/LynyrdSkynyrdFreebirdVideo.mp4;
              add_header X-Upstream  $upstream_addr;
        }

   }

When, from my mpd, i point to localhost:9200/LynyrdSkynyrdFreebirdVideo-Audio.mp4, i first have an OPTIONS request, because of cross origins request; this request is correctly managed; then i see, from network console in the browser, some redirect response (i want use load balancer with a redirect approach, redirecting request to localhost:9200/LynyrdSkynyrdFreebirdVideo-Audio.mp4 to one of my upstream server. So the browser, after this redirect response, will contact directly the chosen upstream server without communicating anymore with load balancer. Well, what i see in network console in browser is the following;

  • some redirect response;

  • XMLHttpRequest cannot load http: // localhost:9200/LynyrdSkynyrdFreebirdVideo.mp4. Redirect from ‘http: // localhost:9200/LynyrdSkynyrdFreebirdVideo.mp4’ to ‘http: // cdn-video/LynyrdSkynyrdFreebirdVideo.mp4’ has been blocked by CORS policy: Request requires preflight, which is disallowed to follow cross-origin redirect.

  • XMLHttpRequest cannot load http: // localhost:9200/LynyrdSkynyrdFreebirdAudio.mp4. Redirect from ‘http: // localhost:9200/LynyrdSkynyrdFreebirdAudio.mp4’ to ‘http: // cdn-audio/LynyrdSkynyrdFreebirdAudio.mp4’ has been blocked by CORS policy: Request requires preflight, which is disallowed to follow cross-origin redirect.

Why there is another request that requires preflight? How could i solve the problem?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
joeyparrishcommented, Jul 10, 2018

Firefox just marked their issue “fixed” for Firefox 63, which is currently scheduled for beta on 2018-09-05 and stable on 2018-10-23. Hope that helps!

1reaction
joeyparrishcommented, Aug 10, 2017

When I checked two weeks ago, the answer was no. Check the bugzilla link to see if they have fixed it yet. If not, comment on the bug and let them know it’s important to you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Firefox does not support CORS redirects · Issue #666 - GitHub
My architecture is composed by a frontend html+js in one container: this container contains all contents in your folder; a nginx container ...
Read more >
Reason: CORS request external redirect not allowed - HTTP
The CORS request was responded to by the server with an HTTP redirect to a URL on a different origin than the original...
Read more >
Extensions redirecting same-origin requests are blocked by ...
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at data:text/javascript,alert(origin). (Reason: CORS request not http) ...
Read more >
CORS POST Requests do not set Origin to "null" after redirect
In my application, I've had to hard-code responding with "null" in Access-Control-Allow-Origin instead of responding with whatever is in the Origin header, ...
Read more >
1444278 - CORS fetches redirected across origins fail ...
It seems we do expect the server to return such a value in Access-Control-Allow-Origin, but the Origin header we send out still contains...
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