1 server {
2 include listen.conf;
3 server_name ucenter.gznow.org;
4
5 location ~ \.php$ {
6 limit_conn one 20;
7 limit_rate 50k;
8 proxy_pass http://s1;
9 include proxy.conf;
10 }
11
12 location / {
13 expires max;
14 root /data/nginx_cache/ucenter;
15 proxy_store on;
16 proxy_store_access user:rw group:rw all:rw;
17 proxy_temp_path /data/nginx_cache/ucenter;
18 include proxy.conf;
19 if ( !-e $request_filename) {
20 proxy_pass http://s1;
21 }
22 }
23 }
24
25 #######################
26 ## 附 proxy.conf 内容 ##
27 #######################
28
29 proxy_redirect off;
30 proxy_set_header Host $host;
31 proxy_set_header X-Real-IP $remote_addr;
32 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
33 proxy_set_header Accept-Encoding 'gzip';
34 client_max_body_size 100m;
35 client_body_buffer_size 256k;
36
37 proxy_connect_timeout 60;
38 proxy_send_timeout 60;
39 proxy_read_timeout 60;
40
41 proxy_buffer_size 512k;
42 proxy_buffers 8 512k;
43 proxy_busy_buffers_size 512k;
44 proxy_temp_file_write_size 512k;