O
O
olezhenka2019-04-22 14:58:20
Nginx
olezhenka, 2019-04-22 14:58:20

Where does header x-frame-options come from?

the only thing I wrote in nginx sites-available/default:

server {
  server_name server.com www.server.com;

  listen [::]:80;
  listen 80;
  listen [::]:443 ssl;
  listen 443 ssl;

  ssl_certificate /etc/letsencrypt/live/server.com/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/server.com/privkey.pem;

  include /etc/letsencrypt/options-ssl-nginx.conf;
  ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

  add_header X-Frame-Options "";

  client_max_body_size 32m;

  location / {
    try_files $uri $uri/ /index.html;
    expires $expires;
    add_header X-Frame-Options "";
  }

  location /api {
    proxy_pass http://localhost:8080;
    add_header X-Frame-Options "";
    proxy_set_header X-Frame-Options "";
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Real-Port $remote_port;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
  }

  root /var/www/server.com/html;
}

Where did I add
add_header X-Frame-Options "";
But when loading the page it is worth the sameorigin...
How to solve it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2019-04-22
@dodo512

Add proxy_hide_header to location /api block

location /api {
    proxy_hide_header X-Frame-Options;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question