Created
May 30, 2012 12:18
-
-
Save gerhard/2835913 to your computer and use it in GitHub Desktop.
nginx multiple proxies
This file contains hidden or 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; | |
server_name dashboard.foo.com; | |
upstream dashboard_backend { | |
server 11.11.12.40:5000 max_fails=3 fail_timeout=1s; | |
} | |
location /{ | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header Host $host; | |
proxy_http_version 1.1; | |
proxy_set_header Connection ''; | |
proxy_pass http://dashboard_backend; | |
proxy_redirect off; | |
} | |
} |
This file contains hidden or 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 443; | |
server_name foo.com; | |
ssl on; | |
location /dashboard { | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header Host $host; | |
proxy_http_version 1.1; | |
proxy_set_header Connection ''; | |
proxy_pass http://dashboard.foo.com; | |
proxy_redirect off; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment