legacy-knowledge-base
公開されました Sep. 10, 2025

X-FRAME-Optionsリファレンスガイド

written-by

Justin Choi

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

この記事は、Liferay Digital Experience PlatformsのX-Frame-Optionsを変更したい人を支援するためのものです。 通常、これは、ウィジェットをポートレットまたはiFrameに埋め込み、HTTPヘッダーがクリックジャックから保護されるようにする場合に必要です。

これらの値は、portal-impl.jar内にある system.properties ファイル(portal.propertiesファイルではありません )にあります

    # Set this to true for the portal to send the "X-Frame-Options: DENY" HTTP
    # header to protect against clickjacking.
    #
    # Custom HTTP header values instead of "DENY" can be specified per URL via
    # the properties "http.header.secure.x.frame.options.*".
    #
    http.header.secure.x.frame.options=true

    #
    # If the property "http.header.secure.x.frame.options" is set to true, then
    # the portal will iterate through the properties
    # "http.header.secure.x.frame.options.*" where the wildcard "*"
    # is replaced with an int number starting from 0 and ending with 255 to find
    # a pipe (|) delimited URL and HTTP header value pair (e.g. "/|SAMEORIGIN").
    #
    # Upon finding a matched a URL, the portal will use the custom HTTP header
    # value instead of the "DENY" value.
    #
    # By default, URLs that start with "/" will use a custom HTTP header value
    # of "SAMEORIGIN". Specify another URL and HTTP header value with a number
    # smaller than 255 to intercept this default behavior.
    #
    http.header.secure.x.frame.options.255=/|SAMEORIGIN

解決策

デフォルト設定を上書きするには、 system-ext.properties ファイルを作成します。 portal.properties ファイルと同様に、ベストプラクティスとして、 system.properties直接変更しないでください。そのためには、ネストされた各ウィジェットは次のようになります

http.header.secure.x.frame.options.1 = /{truncated portal page url} |ALLOW-FROM {web page URL}

例:
http.header.secure.x.frame.options.1=/group/guest/dxp-private-page |ALLOW-FROM https://www.liferay.com/group/customer

終了したら、 system-ext.properties ファイルを \..\ROOT\WEB-INF\classes フォルダに配置します。変更を適用するには、サーバーの再起動が必要になる可能性があります。

追加情報

より一般的な情報については、 System-ext.properties Reference Guide を参照してください。

did-this-article-resolve-your-issue

legacy-knowledge-base