Created
October 31, 2014 15:36
-
-
Save almet/15ea9362dbc5e0ede164 to your computer and use it in GitHub Desktop.
Nginx static files routing
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
// Redirects all /c/{token} and /{token} to the index page, | |
// trying to load the static files if they exist. | |
server { | |
listen 8001; | |
server_name loop.lolnet.org; | |
root /home/www/loop.lolnet.org/; | |
location ~ ^/(c/)?(.*)$ { | |
alias /home/www/loop.lolnet.org/; | |
try_files /$2 /index.html; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment