server {
listen 11.22.33.44:80 ;
server_name site.com ;
root /home/user/sites/site.com;
access_log /etc/nginx/vhost_logs/site.com_access;
error_log /etc/nginx/vhost_logs/site.com_error;
location ~ /.well-known { allow all; }
# location ~* robots.txt { root /etc/nginx; }
location ~ /\.ht {
deny all;
access_log off;
log_not_found off;
}
gzip on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
gzip_comp_level 3;
gzip_types text/plain text/css application/json application/x-javascript text/html text/xml application/xml application/xml+rss text/javascript application/javascript;
location ~* ^.+\.(html)$ {
root /home/user/sites/site.com;
expires 86400s;
proxy_set_header Host $host;
}
location / {
root /home/user/sites/site.com;
proxy_pass
http://11.22.33.44:8080;
proxy_redirect off;
proxy_force_ranges on;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_cache one;
proxy_cache_key "$request_method|$http_if_modified_since|$http_if_none_match|$host|$request_uri";
#access_log /etc/nginx/vhost_logs//home/user/sites/site.com;
proxy_cache_valid 3s;
proxy_cache_min_uses 2;
# proxy_cache_lock on;
# proxy_cache_use_stale error timeout;
# proxy_cache_use_stale updating http_502 http_504;
limit_conn lone 30;
# limit_req zone=ltwo burst=10;
client_max_body_size 24m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 4k;
proxy_buffers 8 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 10m;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}