Nginx正向代理并缓存文件的配置方法
时间:2014-08-14 11:24 来源:linux.it.net.cn 作者:it
nginx 正向代理,nginx缓存文件
与nginx 反向代理并缓存静态文件的区别在于:这是内部机器用来通过Nginx上外网的方式。
其他配置差不多,仅下面有区别:
复制代码代码示例:
server {
listen 83;
location / {
resolver 8.8.8.8;
proxy_pass http://$http_host$uri$is_args$args;
proxy_cache STATIC;
proxy_cache_valid 200 10d;
proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
}
}
(责任编辑:IT)
nginx 正向代理,nginx缓存文件
与nginx 反向代理并缓存静态文件的区别在于:这是内部机器用来通过Nginx上外网的方式。
复制代码代码示例:
server {
(责任编辑:IT)listen 83; location / { resolver 8.8.8.8; proxy_pass http://$http_host$uri$is_args$args; proxy_cache STATIC; proxy_cache_valid 200 10d; proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504; } } |