Welcome! Log In Create A New Profile

Advanced

How to overwrite Cache-Control: private in reverse proxy

Posted by mingxie 
How to overwrite Cache-Control: private in reverse proxy
May 23, 2011 06:46AM
Hi,

Just wonder if there is any way to overwrite / drop the response back Cache-Control: private from a proxied remote server. The setup architecture looks like this (yes, it's a reverse-proxy set up):

[my server] --> [remote server]

The setting for my server site-available/default:

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
}

The setting for my server site-available/remote:

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;

}
}

But Firebug still report the header contains Cache-Control: private. Did I missed something?

Thanks a lot.

PS1: I tried proxy_hide_header, it does not work (either ubuntu natty distribution 0.8.54 and launch pad ppa 1.0.2.)

PS2: I posted the same question in:

http://stackoverflow.com/questions/6076813/overwrite-cache-control-private-in-nginx

In case you would like get some point there.

//M
Re: How to overwrite Cache-Control: private in reverse proxy
May 23, 2011 11:39AM
Sorry about my question. I verified again, sure proxy_hide_header work. I apologized the inconvenience. //m
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 249
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready