踩坑-使用iframe加载网页报Refused to display 'URL' in a frame because it set 'X-Frame-Options' 发表于 2021-10-13 本文字数: 500 热度 ℃ 如果想要允许某个网站加载该网页,可以在nginx中配置 还可以防止点击劫持,阻止页面被其他页面嵌入 12345678910111213141516171819202122server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { # 允许该域名加载网页,允许多个网站时加载时可用","分隔 # add_header X-Frame-Options ALLOW-FROM https://minwk.top,https://game.minwk.top; add_header X-Frame-Options ALLOW-FROM https://minwk.top; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; }