Created
June 1, 2013 18:34
-
-
Save alvinl/5691304 to your computer and use it in GitHub Desktop.
nginx-express
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
server { | |
listen 80; | |
server_name yourdomain.com; | |
# Let's put all static files like images, js and css in sub-folder: public | |
root /opt/apps/firstapp/public; | |
# static content | |
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ { | |
# access_log off; | |
expires 15d; | |
} | |
location / { | |
proxy_pass http://127.0.0.1:3000; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_set_header X-NginX-Proxy true; | |
proxy_redirect off; | |
} | |
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
go be useful