-
-
Save leehambley/46cc2ba95794f5c92693 to your computer and use it in GitHub Desktop.
nginx snippet showing how to configure transparent backend proxying
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
# | |
# This is the proxy location which is used when try_files | |
# can't locate a static file to send the requester | |
# | |
location @unicorn_server { | |
# | |
# Pass requests for this location to | |
# the upstream named `unicorn_server` | |
# | |
proxy_pass http://unicorn_server; | |
# Allows the back-end to see the original request | |
# important if you use request.<methods> in your app | |
proxy_set_header Host $host; | |
# This ensures that when a down-stream proxy error | |
# is raised that nginx handles it using the error | |
# handling we have configured in this file | |
proxy_intercept_errors on; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment