The X-Frame-Options response header

原帖地址:https://developer.mozilla.org/en-US/docs/Web/HTTP/X-Frame-Options?redirectlocale=en-US&redirectslug=The_X-FRAME-OPTIONS_response_header


The X-Frame-Options HTTP responseheader can be used to indicate whether or not a browser should be allowed torender a page in a <frame><iframe>or <object> .

Sites can use this to avoid clickjacking attacks,by ensuring that their content is not embedded into other sites.

Thereare three possible values for X-Frame-Options:

·        DENY

The page cannot be displayedin a frame, regardless of the site attempting to do so.

·        SAMEORIGIN

The page can only be displayedin a frame on the same origin as the page itself.

·        ALLOW-FROM uri

The page can only be displayedin a frame on the specified origin.

In other words, if youspecify DENY, not only will attempts to load the page in a frame fail whenloaded from other sites, attempts to do so will fail when loaded from the samesite.

On the other hand, if you specify SAMEORIGIN,you can still use the page in a frame as long as the site including it in aframe is the same as the one serving the page.

Here we can make it work fromIIS administration, please see the steps below.

1.      Open Internet Information Services (IIS) Manager.

2.      In the Connections pane on the left side, expand the Sites folder andselect the syngentaloyalty website.

3.      Double-click the HTTP Response Headers icon in the feature list in themiddle.

4.      In the Actions pane on the right side, click Add.

5.      In the dialog box that appears, type X-Frame-Options in the Name fieldand type SAMEORIGIN in the Value field.

6.      Click OK to save your changes.


Also you can open web.config to configure IIS to send the X-Frame-Options header, add this your site's Web.config file:


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值