Skip to content

Instantly share code, notes, and snippets.

@anvyzhang
Created February 8, 2014 09:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anvyzhang/d3d0c17d5e62256fa79e to your computer and use it in GitHub Desktop.
Save anvyzhang/d3d0c17d5e62256fa79e to your computer and use it in GitHub Desktop.
nginx site-enabled conf file
upstream test_site {
server 127.0.0.1:3000;
}
server {
#auth_basic "Restricted";
#auth_basic_user_file /etc/nginx/httppwd;
listen 80;
server_name a.test_site.com;
root /home/deploy/apps/test_site/current;
client_max_body_size 200M;
client_header_timeout 3m;
client_body_timeout 5m;
send_timeout 5m;
gzip on;
gzip_proxied any;
gzip_comp_level 2;
gzip_min_length 1100;
gzip_types text/plain text/css application/javascript application/xml application/json text/javascript application/x-javascript;
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires 30d;
add_header Cache-Control public;
add_header Last-Modified "";
log_not_found off;
access_log off;
proxy_hide_header Set-Cookie; #
proxy_pass http://test_site;
}
location / {
proxy_hide_header X-Frame-Options;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_hide_header ETag; #
proxy_hide_header Cache-Control; #
add_header Expires 'Fri, 01 Jan 1990 00:00:00 GMT'; #
add_header Cache-Control 'no-cache, must-revalidate, no-store'; #
add_header Pragma 'no-cache'; #
proxy_pass http://test_site;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment