【问题标题】:Overwrite Cache-Control: Private in Nginx覆盖缓存控制:Nginx 中的私有
【发布时间】:2011-05-20 19:38:18
【问题描述】:

只是想知道是否有任何方法可以覆盖/删除来自代理远程服务器的响应缓存控制:私有。设置架构如下所示(是的,它是反向代理设置):

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

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

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 仍然报告 header 包含 Cache-Control: private。我错过了什么吗?

谢谢。

【问题讨论】:

    标签: http-headers nginx reverse-proxy cache-control


    【解决方案1】:

    你想要proxy_hide_header 而不是 proxy_ignore_headers

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-06-27
      • 1970-01-01
      • 2017-06-07
      • 2012-10-06
      • 1970-01-01
      • 2012-11-21
      • 2013-09-30
      • 2017-01-10
      相关资源
      最近更新 更多