码迷,mamicode.com
首页 > 其他好文 > 详细

add_header X-Frame-Options "SAMEORIGIN";NGINX

时间:2015-08-03 14:55:44      阅读:516      评论:0      收藏:0      [点我收藏+]

标签:nginx   add_header   x-frame-options   sameorigin   

NGINX配置文件中    server {   }   中添加


add_header X-Frame-Options "SAMEORIGIN";


防止该网站页面被其他网站嵌套,我们可以通过下面的工具进行测试:


http://www.w3school.com.cn/tiy/t.asp?f=html_frame_cols


编辑html代码,嵌套要测试的网站页面:

<html>
<frameset cols="50%,50%">
  <frame src="http://xxx.xxxxxx.cn/m_index.html">
  <frame src="http://yyy.xxxxxx.cn/m_index.html">
</frameset>
</html>

效果如下,其中xxx.xxxxxx.cn设置了防嵌套,yyy.xxxxxx.xn没有设置放嵌套:

技术分享

add_header X-Frame-Options "SAMEORIGIN";NGINX

标签:nginx   add_header   x-frame-options   sameorigin   

原文地址:http://www1707.blog.51cto.com/1184226/1681208

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!