-
-
Save JonasGao/89370dc9cf84f4bbc1131fce2e700635 to your computer and use it in GitHub Desktop.
How to have nginx proxy_pass follow upstream 302 redirects (Minimal, without Cache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
charset utf-8; | |
location / { | |
proxy_pass http://web; | |
proxy_intercept_errors on; | |
error_page 301 302 307 = @handle_redirects; | |
} | |
location @handle_redirects { | |
set $orig_loc $upstream_http_location; | |
proxy_pass $orig_loc; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi. I made a load balancer using Upstream. as follows.
I set nginx.conf similar to above.
It's working fine now, but the main server domain.com:443 is heavily affected by live streams. How can I 302 forward this traffic to the edge servers?
So I want to direct every incoming request as a link to the end servers.
domain.com/hls/test.m3u8 > srv1.domain.com/hls/test.m3u8
domain.com/hls/test.m3u8 > srv2.domain.com/hls/test.m3u8
*
*
As. I want to distribute live streams to upstream servers.
Thanks.