Skip to content

Instantly share code, notes, and snippets.

@janecakemaster
Created April 16, 2014 05:48
Show Gist options
  • Save janecakemaster/10812869 to your computer and use it in GitHub Desktop.
Save janecakemaster/10812869 to your computer and use it in GitHub Desktop.
nginx config for serving nodejs on /app
server {
listen 80;
server_name example.com;
root /path/to/static/files;
location / {
try_files $uri $uri/ /index.html;
}
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
expires 15d;
}
location ^~ /app/ {
proxy_buffering off;
rewrite /app/(.*) /$1 break;
proxy_pass http://127.0.0.1:3000;
proxy_redirect default;
}
gzip on;
gzip_comp_level 2;
gzip_proxied any;
gzip_min_length 1000;
gzip_disable "MSIE [1-6]\."
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment