Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Apache has a patch to block the Do Not Track header for Internet Explorer 10. What Nginx configuration change can I use to do the same?

share|improve this question
    
Thinking a combination of more_set_input_headers (wiki.nginx.org/HttpHeadersMoreModule#more_set_input_headers) and something with the IE user agent –  Carson Reinke Oct 4 '12 at 13:36
add comment

1 Answer

up vote 1 down vote accepted

When nginx is a reverse proxy to upstream backend servers, use proxy_set_header, something like this:

proxy_set_header DNT ""

When sending to FastCGI/FPM, such as in the case of PHP, use fastcgi_hide_header, for example:

fastcgi_hide_header DNT

Keep in mind you'll have to wrap this in an if to test for IE 10, and If is evil, so this configuration will probably come back to bite you. If you only have one if in the location block, you'll probably be OK...

if ($http_user_agent ~ Trident/6.0) {
    proxy_set_header DNT ""
}
share|improve this answer
    
Wanted to avoid "if", but this might be the only way do this –  Carson Reinke Dec 5 '12 at 19:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.