Override Content-Type header with proxied requests

manish-ezest nginx-forum at nginx.us
Wed Aug 6 12:18:16 UTC 2014

Hello Appa,

I am having the same issue. I want NGINX to serve all the json file from
upstream as a content type of application/json.I tried with map just like
you suggested but I am not able to figure out what should be inside map(That
you have written below), Can you please suggest?

map $upstream_http_content_type $s3_content_type {
# S3 -> real...

location ~ \.json$ {
        proxy_hide_header Content-Type;
        add_header Content-Type $s3_content_type;


Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239473,252358#msg-252358

More information about the nginx mailing list