Created
January 14, 2015 10:08
-
-
Save lextoumbourou/d6221deb818da4f342ea to your computer and use it in GitHub Desktop.
Conditional Nginx error pages based on Accept (or other) headers
This file contains hidden or 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
http { | |
map $http_accept $extension { | |
default html; | |
application/json json; | |
} | |
server { | |
listen 80; | |
error_page 500 /500; | |
location = /500 { | |
internal; | |
alias /var/www/error/403.$extension; | |
} | |
} | |
} |
stereobooster
commented
Jul 11, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment