CentOS Linux 7.6.1810 (Core),
BT6.8.8
openresty 1.13.6.2
==================
新建的一个网站, 在网站配置"反向代理"配置中, 新增的配置(选择不缓存的情况下), 可以看到配置文件如下, 有一行显示 expires 12h; 应该显示 expires -1才对;
用谷歌浏览器开发工具实测: 该值为 -1 时才是真正的不缓存, 为12h的时候会被缓存.
- #PROXY-START/
- location /
- {
- location ~ .*\.(php|jsp|cgi|asp|aspx|flv|swf|xml)?$
- {
- 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 REMOTE-HOST $remote_addr;
- proxy_pass http://127.0.0.1;
-
- }
- proxy_pass http://127.0.0.1:8080/;
- 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 REMOTE-HOST $remote_addr;
-
- #持久化连接相关配置
- #proxy_connect_timeout 30s;
- #proxy_read_timeout 86400s;
- #proxy_send_timeout 30s;
- #proxy_http_version 1.1;
- #proxy_set_header Upgrade $http_upgrade;
- #proxy_set_header Connection "upgrade";
- add_header X-Cache $upstream_cache_status;
-
-
- <font color="#ff0000"><b> expires 12h;</b></font>
- }
- #PROXY-END/
复制代码
|
|