PR 広告

Nextcloud Strict-Transport 解決方法

07-Strict-Transport-Security HTTP ヘッダーの秒数が少なくとも Nextcloud
【PR】当サイトはアフィリエイト広告を利用しています。

【2022年12月】エックスサーバーで、Nextcloud Strict-Transport-Security “HTTP ヘッダーの秒数が少なくとも”15552000” に設定されていません。 解決方法

[December 2022] On X server, Nextcloud says “The “Strict-Transport-Security” HTTP header is not set to at least “15552000” seconds.” How to solve a problem with.

その他の解決方法については、下記の記事をご覧ください。

セキュリティ&セットアップ警告
Security & setup warnings

Strict-Transport-Security “HTTP ヘッダーの秒数が少なくとも”15552000” に設定されていません。
The “Strict-Transport-Security” HTTP header is not set to at least “15552000” seconds.

公式サイトの文書

Enable HTTP Strict Transport Security
HTTP Strict トランスポート セキュリティを有効にする

While redirecting all traffic to HTTPS is good, it may not completely prevent man-in-the-middle attacks. Thus administrators are encouraged to set the HTTP Strict Transport Security header, which instructs browsers to not allow any connection to the Nextcloud instance using HTTP, and it attempts to prevent site visitors from bypassing invalid certificate warnings.
すべてのトラフィックを HTTPS にリダイレクトすることは良いことですが、中間者攻撃を完全に防ぐことはできません。したがって、管理者は HTTP Strict Transport Security ヘッダーを設定することをお勧めします。このヘッダーは、ブラウザーに HTTP を使用した Nextcloud インスタンスへの接続を許可しないように指示し、サイトの訪問者が無効な証明書の警告をバイパスするのを防止しようとします。

This can be achieved by setting the following settings within the Apache VirtualHost file:
これは、Apache VirtualHost ファイル内で次の設定を行うことで実現できます。

<VirtualHost *:443>
  ServerName cloud.nextcloud.com
    <IfModule mod_headers.c>
      Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
    </IfModule>
 </VirtualHost>
https://docs.nextcloud.com/server/25/admin_manual/installation/harden_server.html#enable-http-strict-transport-security

エックスサーバー スタンダードプランで修正します。

エックスサーバーのファイルマネージャを使います。

https://(あなたのドメイン名)/(nextcloud をインストールしたフォルダ)/.htaccess に、次の内容を追加します。

※サブドメインのドキュメントルートに、Nextcloud をインストールしている場合は、
https://(あなたのサブドメイン名).(あなたのドメイン名)/.htaccess に、次の内容を追加します。

<IfModule mod_headers.c>
  Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
  <IfModule mod_setenvif.c>
タイトルとURLをコピーしました