Problems with proxy_hide_header defaults, and proxy_set_header X-Powered-By not applying.

Maxim Dounin mdounin at
Wed Mar 10 19:10:14 MSK 2010


On Wed, Mar 10, 2010 at 09:10:27AM -0600, David Taveras wrote:

> a.) The wiki says under proxy_hide_header  directive  that by default
> nginx does not transfer the "Date", "Server", "X-Pad" and
> "X-Accel-..."
> If I do lynx  -dump -head i can still see: Date: Wed, 10 Mar 2010
> 14:43:37 GMT .. and this is not the time of the nginx box.. where is
> this coming and how can I hide it?

What makes you think that it's not the time of the nginx box?  
Note well: it's in GMT as required by RFC 2616, not in your local 

And no, you can't stop nginx from sending Date header as it's 
required per RFC 2616.  The only thing you may do is to pass 
to client original Date header as got in response from backend 
(via proxy_pass_header Date).


> b.) I set this up:
> proxy_hide_header X-Powered-By; which does work great... but when I
> set proxy_set_header X-Powered-By "BogusPHPversion"; it doesnt work..
> no errors when starting nginx. How can I accomplish this?

Directive proxy_set_header sets headers to be sent to backend 
server.  If you want to add headers to response you should use 
add_header directive.

Maxim Dounin

More information about the nginx mailing list