开发者

X-Frame-Options header missing (Nginx Config)

开发者 https://www.devze.com 2022-12-07 17:56 出处:网络
So, i\'m already added X-Frame-Options in nginx config below : location /api/ { proxy_pass http://127.0.0.1:8181/secure/;

So, i'm already added X-Frame-Options in nginx config below :

location /api/ {
    proxy_pass http://127.0.0.1:8181/secure/;
    add_header X-Frame-Options "DENY";
}

but when i check from header response in network, the X-Frame-Options not showing at all.

X-Frame-Options header missing (Nginx Config)

if customed the random header key, like

X-Frame-Optionszzz "DEN开发者_C百科Y";

The header response showing correctly as the key and value.

X-Frame-Options header missing (Nginx Config)

Why nginx look like blocking my X-Frame-Options header?


Why do you want to set X-Frame-Options? When frame-ancestors is set in your Content-Security-Policy all modern browsers will ignore X-Frame-Options anyway. This could be the reason why nginx removes the header and doesn't remove custom headers.

0

精彩评论

暂无评论...
验证码 换一张
取 消