Skip to content

Instantly share code, notes, and snippets.

@alvinl
Created June 1, 2013 18:34
Show Gist options
  • Select an option

  • Save alvinl/5691304 to your computer and use it in GitHub Desktop.

Select an option

Save alvinl/5691304 to your computer and use it in GitHub Desktop.
nginx-express
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;
}
@ruunex

ruunex commented Aug 31, 2013

Copy link
Copy Markdown

go be useful

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