# cat /opt/configs/nginx/conf/globals/switch_standard.conf
proxy_ignore_headers Expires Cache-Control;
proxy_cache_bypass $cookie_session;
proxy_no_cache $cookie_session;
## MR - increasing upload size to 64M (declare inside 'location /' not work
client_max_body_size 64M;
client_body_buffer_size 128k;
#proxy_buffers 32 4k;
proxy_buffers 8 128k;
proxy_buffer_size 128k;
proxy_request_buffering off;
### MR -- must be using nginx-special (including ngx_purge_cache)
location ~ /purge(/.*) {
### MR -- just enough remove # below for enable
#proxy_cache_purge pcache "$scheme://$host$1$request_method";
allow 127.0.0.1;
deny all;
}
#location / {
location ~* \.(php|pl|py|rb|cgi)$ {
## MR -- move to ~lxcenter.conf
#limit_conn addr 25;
## MR - no need try_files because permalink handle by apache
#try_files $uri $uri/ /index.php;
proxy_pass
http://127.0.0.1:30080/; proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#proxy_set_header X-Forwarded-For $remote_addr;
#proxy_set_header X-Forwarded-SSL on;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass_header Set-Cookie;
proxy_headers_hash_max_size 512;
### MR -- just enough remove # below for enable cache
proxy_cache pcache;
#proxy_cache_valid 10m;
#proxy_cache_valid 404 1m;
## for microcache
proxy_cache_valid 200 5s;
proxy_cache_use_stale updating;
proxy_max_temp_file_size 1M;
proxy_cache_key "$scheme://$host$request_uri";
add_header X-Micro-Cache $upstream_cache_status;
#proxy_cache_use_stale error timeout invalid_header http_500 http_502 http_504 http_404;
open_file_cache max=1024 inactive=600s;
open_file_cache_valid 2000s;
open_file_cache_min_uses 1;
open_file_cache_errors on;
}
### MR -- Enable this if not using nginx cache and not for wordpress
# location ~* ^.+\.(jpe?g|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|swf|avi|mp3)$ {
# expires 2d;
# access_log off;
# root $var_rootdir;
# }
location ~ /\.ht {
deny all;
}
if (-f $request_filename) {
break;
}
if (-d $request_filename) {
break;
}