2
feiandxs 2013-06-23 13:04:35 +08:00 1
别的不说
proxy_cache_valid 200 301 302 1m; proxy_cache_valid any 1m; 是挺傻的 |
4
Showfom 2013-06-23 13:41:28 +08:00 1
我给我们的图床做的反代的代码,反正就图片。。。
server { listen 80; server_name ki.ki.ki; location / { proxy_pass http://dulei.si/; proxy_redirect default; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 10m; client_body_buffer_size 512k; proxy_connect_timeout 5; proxy_read_timeout 60; proxy_send_timeout 5; proxy_buffer_size 16k; proxy_buffers 4 64k; proxy_busy_buffers_size 128k; proxy_cache cache_one; proxy_cache_valid 200 304 365d; proxy_cache_key $host$uri$is_args$args; expires max; } } 不过你给本机做反代的话, HTML 真没必要做缓存啊 |
6
Channing 2013-06-23 21:12:06 +08:00 1
公共部分的处理:
----- my_proxy.conf ----- proxy_pass http://127.0.0.1:91; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; ----- 你的配置文件 ----- location = / { include my_proxy.conf; } location ~ \.html { include my_proxy.conf; #其他配置 } |