Strip away cookie related headers from nginx response for static content
January 16, 2015 06:12AM
Given this piece of nginx configuration to serve static content from static.domain.tld

server {
listen 80;

server_name static.domain.tld;

root /path/to/files;

error_log /path/to/log;

sendfile on;
tcp_nopush on;

location / {
add_header Cache-Control public;
add_header Pragma public;
expires max;
}
}

how do ignore and strip away Set-Cookie header from response?

I read about

proxy_hide_header Set-Cookie
proxy_ignore_headers Set-Cookie
proxy_set_header Cookie ""

but I think they'd be of no use because server is not using proxy_pass directive.

Am I correct? If so, any alternatives?

Thanks in advance,
Adriano
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 110
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