External website refused to connect in an iFrame in Confluence

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Fisheye および Crucible は除く

問題

When embedding an external website within the Confluence page in an <iframe/>, the website doesn’t load and display below in iFrame

example.website.com refused to connect.

環境

  • Confluence Server および Data Center

Diagnostic Steps

  • Create a Page in Confluence
  • Embed the website in iFrame using the HTML Include macro. Reference: How to put an iFrame into Confluence

    <iframe src="https://example.website.com/" noborder="0" width="830" height="800" scrolling="yes" seamless></iframe>
  • The Preview of the website fails with the error example.website.com refused to connect
  • Review the console in the browser with Developer Tools (Ctrl+Shift+i)
  • In the Developer Console of your browser, check the Network logs (where all request/respond flows are listed), please check X-Frame-Options in the response headers of the relevant request for the external website. If it is displayed as DENY, the page can't be displayed in a frame

Other than checking the network logs, the below URL can also be used to validate the X-Frame-Options header options on the WebServer-

原因

As we can see from the X-Frame-Options - HTTP - MDN article:

DENY
The page cannot be displayed in a frame, regardless of the site attempting to do so.
.
.
If you specify DENY, not only will attempts to load the page in a frame fail when loaded from other sites, attempts to do so will fail when loaded from the same site.

ソリューション

Unless the website owners change the X-Frame-Options header, the website cannot embed inside of an iframe element.


Last modified on Mar 31, 2023

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.