https://developer.mozilla.org/zh-CN/docs/Web/HTTP/X-Frame-Options
https://blog.csdn.net/yangye1225/article/details/78957566
設置 https://developer.mozilla.org/zh-CN/docs/Web/HTTP/X-Frame-Options
可以正常使用
add_header X-Frame-Options ALLOWALL;
語法
X-Frame-Options
有三個可能的值:
X-Frame-Options: deny X-Frame-Options: sameorigin X-Frame-Options: allow-from https://example.com/
指南
換一句話說,如果設置為 deny
,不光在別人的網站 frame 嵌入時會無法加載,在同域名頁面中同樣會無法加載。另一方面,如果設置為sameorigin
,那么頁面就可以在同域名頁面的 frame 中嵌套。
-
deny
- 表示該頁面不允許在 frame 中展示,即便是在相同域名的頁面中嵌套也不允許。
-
sameorigin
- 表示該頁面可以在相同域名頁面的 frame 中展示。
-
allow-from uri
- 表示該頁面可以在指定來源的 frame 中展示。
- 設置完即可使用
-
找到了新的優先級更高的配置
https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Headers/Content-Security-Policy/frame-ancestors
Content-Security-Policy: frame-ancestors <source>;的優先級 高於X-Frame-Options
add_header Content-Security-Policy "frame-ancestors *"; 所有網頁都可以進行嵌入
標簽:-s 指定 可能 mozilla 指南 security
原文:https://www.cnblogs.com/njccqx/p/13328740.html