Skip to content

Instantly share code, notes, and snippets.

@emmiep
Last active July 3, 2018 12:18
Show Gist options
  • Select an option

  • Save emmiep/eee0e3a3815e94f7acd9e11e06e15184 to your computer and use it in GitHub Desktop.

Select an option

Save emmiep/eee0e3a3815e94f7acd9e11e06e15184 to your computer and use it in GitHub Desktop.
Nginx basic SPA config
http {
server {
listen 80;
root /usr/share/nginx/html;
location / {
internal;
}
location ~ ^/(js/|img/|css/|favicon\.ico$) {
try_files $uri =404;
}
location ~ (^/|/[^./]+/?)$ {
rewrite ^/(.+)/$ /$1 permanent;
try_files $uri.html /index.html;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment