Skip to content

Instantly share code, notes, and snippets.

@demisx
Last active March 28, 2020 18:23
Show Gist options
  • Save demisx/9500367 to your computer and use it in GitHub Desktop.
Save demisx/9500367 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;
}
}
@tantita
Copy link

tantita commented Jun 23, 2016

pls how did u generate d snapshots u used on line 16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment