how to check if my nginx server has x-frame disabled

Viewed 122

I'm doing a port 80 redirect with namecheap : i'm doing mydomain.com to redirect to my server 400.300.200.100:myport. myport is not 80 but another port.

Now namecheap is stating "If the server (you are redirecting the domain to) has X-Frame feature disabled, you may select a Masked Redirect for the client's browser to display your domain name instead of http://1.2.3.4:50."

I would like my domain to be displayed instead of myserver:port. So where should i check if I have x frame disabled? in my react frontend ? in my nginx configuration?

Should I put

X-Frame-Options: DENY

or

X-Frame-Options: SAMEORIGIN

?

Can someone tell me if i need to configure this on nginx?

this is my nginx.conf

server {
    listen 80;
    server_name localhost; 
    location / {
        root /usr/share/nginx/html/storybook-static; 
        index index.html index.htm;
        try_files $uri $uri/ /index.html;
        } 
    location /wagtail {
        proxy_pass http://172.20.128.2:8000;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Script-Name /wagtail;

        }

    location /static/ {
        alias /app/static/;
    }
    location /media/ {
        alias /app/media/;
    }
}
1 Answers

For security reasons usually an xframe 'same origin' option is used.

  • Go to where Nginx is installed and then a conf folder
  • check the following parameter in nginx.conf under server section add_header X-Frame-Options.

Another way is to go to your Nginx installation directory, if using Linux and run

grep -rnw 'X-Frame' 

It will show you all files with header traces.

Related