Skip to content

Instantly share code, notes, and snippets.

@anvyzhang anvyzhang/nginx_site.conf Secret
Created Feb 8, 2014

What would you like to do?
nginx site-enabled conf file
upstream test_site {
server {
#auth_basic "Restricted";
#auth_basic_user_file /etc/nginx/httppwd;
listen 80;
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
You can’t perform that action at this time.