影落离风

The shadow falls away from the wind

0%

踩坑-使用iframe加载网页报Refused to display 'URL' in a frame because it set 'X-Frame-Options'

  1. 如果想要允许某个网站加载该网页,可以在nginx中配置
  2. 还可以防止点击劫持,阻止页面被其他页面嵌入
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
server {
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;
}