Skip to content

Duplicate header X-Content-Type-Options when using fastcgi and upstream server #744

Discussion options

You must be logged in to vote

I found a blog post with a workaround using the map directive
https://www.axllent.org/docs/add-nginx-headers-if-not-set/

http {
    server_tokens off;
    map $upstream_http_x_content_type_options $hdr_x_content_type_options {
        '' "nosniff";
    }
    add_header X-Content-Type-Options $hdr_x_content_type_options;

    upstream php_upstream {
        server 127.0.0.1:9000;
    }

Seems to fix it for me

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kevin-kortum-trustedshops
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant