Created
January 17, 2013 16:04
-
-
Save nossila/4557033 to your computer and use it in GitHub Desktop.
This gist shows how to setup a custom error_page on nginx when using error_page as a way to redirect requests to a upstream server. You need to set recursive_error_pages on for error_page to work like expected.
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 { | |
recursive_error_pages on; | |
location / { | |
error_page 404 = @memcached; | |
} | |
location @memcached { | |
proxy_pass http://upstreamserver; | |
} | |
error_page 500 502 503 504 /50x.html; | |
location = /50x.html { | |
root /var/www/error-pages/; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment