Skip to content

Instantly share code, notes, and snippets.

@ncole458
Last active April 18, 2018 10:42
Show Gist options
  • Save ncole458/35a67293e1c48a0923b6 to your computer and use it in GitHub Desktop.
Save ncole458/35a67293e1c48a0923b6 to your computer and use it in GitHub Desktop.
Nginx 'sites-available' rewrite for Ember.js (Ember breaks on refresh 404)
# Ember breaks on refresh (404)
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
# Add the below rule to fix
if (!-e $request_filename){
rewrite ^(.*)$ /index.html break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment