keepalive_timeout 15;
### MR -- just enough remove # below for enable nginx cache
fastcgi_cache fcache;
#fastcgi_cache_valid 200 1h;
#fastcgi_cache_valid 301 1h;
#fastcgi_cache_valid 302 1h;
#fastcgi_cache_valid any 1m;
fastcgi_cache_key "$scheme$request_method$host$request_uri";
add_header X-Micro-Cache $upstream_cache_status;
## MR - increasing upload size to 64M (declare inside 'location /' not work
client_max_body_size 64M;
client_body_buffer_size 128k;
fastcgi_buffer_size 128k;
fastcgi_buffers 8 128k;
fastcgi_request_buffering off;
### MR -- must be using nginx with including ngx_purge_cache
### must be using special nginx (nginx with ngx_purge_cache include
location ~ /purge(/.*) {
### MR -- just enough remove # below for enable purge_cache
#proxy_cache_purge pcache "$scheme://$host$1$request_method";
allow 127.0.0.1;
deny all;
}
### MR -- for userdir (access with
http://ip/~user)
location ~ ^/~(.+?)(/.*)?$ {
if (!-f /home/$1/public_html/$2) {
rewrite ^ 404;
}
alias '/home/$1/public_html$2';
#autoindex on;
}
location ~ \.php$ {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
#fastcgi_pass 127.0.0.1:$var_fpmport;
fastcgi_pass unix:/opt/configs/php-fpm/sock/$var_phpselected-$var_user.sock;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
}
location / {
limit_conn conn_limit_per_ip 50;
limit_req zone=req_limit_per_ip burst=250 nodelay;
try_files $uri $uri/ /index.php;
}