luceos 发表于 2020-4-8 02:03
只缓存静态文件?
244643246 发表于 2020-4-8 02:35
这个直接复制进去不行,提示错误,nginx: [emerg] "proxy_cache_path" directive is not allowed here in ...

不懂,围 观一下。
244643246 发表于 2020-4-8 02:08
是的,反向代理配置添加这段代码是现实了缓存,但我认为这不不是常规的写法#缓存
location /(js|png|css| ...
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
proxy_pass https://www.11daishua.com;
add_header X-Cache $upstream_cache_status;
expires 5d;
}
location ~ .*\.(js|css)$
{
proxy_pass https://www.11daishua.com;
add_header X-Cache $upstream_cache_status;
expires 5d;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
proxy_pass https://www.11daishua.com;
add_header X-Cache $upstream_cache_status;
expires 5d;
}
location ~ .*\.(js|css)$
{
proxy_pass https://www.11daishua.com;
add_header X-Cache $upstream_cache_status;
expires 5d;
}
| 欢迎光临 全球主机交流论坛 (https://mjj.022333.xyz/) | Powered by Discuz! X3.4 |