Last active
February 11, 2019 15:48
-
-
Save mm53bar/4698426 to your computer and use it in GitHub Desktop.
A simple nginx virtual server config. Should redirect all requests to / except for those that actually have a match (i.e. html/images/css/js).
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 amaroadreports.ca www.amaroadreports.ca; | |
root /srv/road_reports_static; | |
location / { | |
try_files $uri/index.html $uri.html $uri @missing; | |
} | |
location @missing { | |
rewrite ^ $scheme://$host/ redirect; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've added this to a script to download Sarah's page and setup nginx - I didn't get a chance to test this locally yet:
https://gist.github.com/4705042