Last active
April 18, 2018 10:42
-
-
Save ncole458/35a67293e1c48a0923b6 to your computer and use it in GitHub Desktop.
Nginx 'sites-available' rewrite for Ember.js (Ember breaks on refresh 404)
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
# 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