Last active
September 8, 2023 00:41
-
-
Save taddev/6212449 to your computer and use it in GitHub Desktop.
Nginx Reverse Proxy with custom error if upstream proxy is not working.
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 { | |
listen 80; | |
listen [::]:80 default server ipv6only=on; | |
location / { | |
proxy_intercept_errors on; | |
proxy_pass http://localhost:9000; | |
} | |
error_page 500 502 503 504 /50x.html; | |
location = /50x.html { | |
root /var/www/errors; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for sharing