Created
April 16, 2014 05:48
-
-
Save janecakemaster/10812869 to your computer and use it in GitHub Desktop.
nginx config for serving nodejs on /app
This file contains hidden or 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
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