Firefox does not support CORS redirects
See original GitHub issueMy 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:
- Created 7 years ago
- Comments:16 (10 by maintainers)
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!
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.