events
{
use epoll;
worker_connections 65535;
}
server {
include listen.conf;
server_name www.it.net.cn;
location ~ \.php$ {
limit_conn one 20;
limit_rate 50k;
proxy_pass http://s1;
include proxy.conf;
}
location / {
expires max;
root /data/nginx_cache/ucenter;
proxy_store on;
proxy_store_access user:rw group:rw all:rw;
proxy_temp_path /data/nginx_cache/ucenter;
include proxy.conf;
if ( !-e $request_filename) {
proxy_pass http://s1;
}
}
}
#######################
## 附 proxy.conf 内容 ##
#######################
proxy_redirect off;
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_set_header Accept-Encoding 'gzip';
client_max_body_size 100m;
client_body_buffer_size 256k;
proxy_connect_timeout 60;
proxy_send_timeout 60;
proxy_read_timeout 60;
proxy_buffer_size 512k;
proxy_buffers 8 512k;
proxy_busy_buffers_size 512k;
proxy_temp_file_write_size 512k;