Skip to content

Instantly share code, notes, and snippets.

@almet
Created October 31, 2014 15:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save almet/15ea9362dbc5e0ede164 to your computer and use it in GitHub Desktop.
Save almet/15ea9362dbc5e0ede164 to your computer and use it in GitHub Desktop.
Nginx static files routing
// 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