Created
March 13, 2013 04:52
-
-
Save cbednarski/5149466 to your computer and use it in GitHub Desktop.
Example nginx.conf for custom error pages
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; | |
server_name HOSTNAME; | |
root /opt/PATH/; | |
index index.html; | |
rewrite ^/$ /en/PATH/ redirect; | |
error_page 403 /403.html; | |
error_page 404 /404.html; | |
error_page 500 /500.html; | |
error_page 502 /502.html; | |
error_page 503 /503.html; | |
error_page 504 /504.html; | |
location / { | |
try_files $uri $uri/ index.html; | |
} | |
location ~ /([0-9]{3}).html { | |
try_files $1.html @error; | |
internal; | |
} | |
location @error { | |
root /opt/error-pages; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment