Reputation: 35276
In what way the charset for the Content-Type
response be removed?
Content-Type: text/plain;charset=iso-8859-1
The nginx.conf file is already set to
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
charset off;
server {
listen 80;
server_name ~. "";
location / {
proxy_pass http://localhost:8080;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
}
}
}
Is there a way to force remove the charset?
Upvotes: 1
Views: 1445
Reputation: 15478
Can you try this:
map $upstream_http_content_type $stripped_content_type {
"~^(.+);charset=" $1;
default $upstream_http_content_type;
}
server {
...
location / {
...
proxy_hide_header Content-Type;
add_header Content-Type $stripped_content_type;
}
}
Upvotes: 1