繁体   English   中英

覆盖缓存控制:Nginx中的私有

[英]Overwrite Cache-Control: Private in Nginx

只是想知道是否有任何方法可以从代理的远程服务器覆盖/删除响应Cache-Control:private。 设置架构看起来像这样(是的,它是一个反向代理设置):

[我的服务器] - > [远程服务器]

我的服务器站点可用/默认设置:

server {

        listen   80; ## listen for ipv4
        listen   [::]:80 default ipv6only=on; ## listen for ipv6

        server_name  localhost;


        location / {
            if ($arg_AWSACCESSKEY) {    
                proxy_pass http://localhost:8088;
            }
            try_files $uri $uri/ /index.php /index.html /index.htm;
        }
    # other setting goes here
}

我的服务器站点可用/远程的设置:

server {
        listen   8088; ## listen for ipv4; this line is default and implied

        # Make site accessible from http://localhost/
        # server_name localhost;

        location / {
                proxy_pass http://remoteserver;
                proxy_set_header Host remoteserverhostname.com;
                proxy_ignore_headers Cache-Control Expires;
                proxy_pass_header Set-Cookie;

        }
}

但是Firebug仍然报告头部包含Cache-Control:private。 我错过了什么吗?

谢谢。

您需要proxy_hide_header而不是proxy_ignore_headers

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM