Created
September 19, 2016 18:05
-
-
Save anonymous/f6f0c3d2076fa208c0530c1c4787118c to your computer and use it in GitHub Desktop.
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; | |
# Proxy settings | |
# resolver 127.0.0.11; | |
proxy_redirect off; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real_IP $remote_addr; | |
proxy_set_header X-Forwarded_For $proxy_add_x_forwarded_for; | |
# This nonsense is to force runtime (instead of boot-time) resolution of DNS | |
# so that Docker containers can be swapped, while being functionally | |
# equivalent to the following block: | |
# | |
# location /api/ { | |
# proxy_pass http://server/; | |
# } | |
# | |
# It rewrites the path, stripping the prefix of the location block, so that | |
# Rails doesn't have to be completely aware that it's nested under /api/. | |
location /api/ { | |
proxy_pass http://server/api/; | |
# set $upstream "http://server/"; | |
# proxy_pass $upstream$1$is_args$args; | |
} | |
location / { | |
proxy_pass http://client/; | |
# set $upstream "http://client/"; | |
# proxy_pass $upstream$1$is_args$args; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment