Skip to content

Instantly share code, notes, and snippets.

@leehambley
Created November 28, 2010 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leehambley/46cc2ba95794f5c92693 to your computer and use it in GitHub Desktop.
Save leehambley/46cc2ba95794f5c92693 to your computer and use it in GitHub Desktop.
nginx snippet showing how to configure transparent backend proxying
#
# 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