Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save wstam88/dd7152d7fa9f080d8e020a8391faf287 to your computer and use it in GitHub Desktop.
Save wstam88/dd7152d7fa9f080d8e020a8391faf287 to your computer and use it in GitHub Desktop.
Nginx config for HTML5 AngularJS applications
server {
listen 8000;
server_name localhost;
root /Users/dmoore/projects/tutorials/angular-phonecat2/.build;
access_log "/Users/dmoore/projects/tutorials/angular-phonecat2/logs/hotili-net.access.log";
error_log "/Users/dmoore/projects/tutorials/angular-phonecat2/logs/hotili-net.error.log";
error_page 404 /app/404.html;
error_page 403 /app/403.html;
index index.html;
# SEO
if ($args ~ "_escaped_fragment_=/?(.+)") {
set $path $1;
rewrite ^ /snapshots/$path last;
}
location ~* \.(gif|jpg|jpeg|png|js|css)$ {
}
location / {
allow 127.0.0.1;
deny all;
expires -1;
add_header Pragma "no-cache";
add_header Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0";
try_files $uri $uri/ /index.html =404;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment