Manual:$wgForceHTTPS
| サーバー URL とファイル パス: $wgForceHTTPS | |
|---|---|
| セキュアではない HTTP リクエストを HTTPS にリダイレクトする。 |
|
| 導入されたバージョン: | 1.34.3 (Gerrit change 608504; git #c75eef91) |
| 除去されたバージョン: | 使用中 |
| 許容される値: | (真偽値) |
| 既定値: | false (gerrit:608504, gerrit:612497, gerrit:615840) |
| その他の設定: アルファベット順 | 機能順 | |
詳細
If this configuration parameter is set to true when receiving an insecure HTTP request, it will always redirect to HTTPS.
This overrides and disables the preferhttps user preference, and it overrides $wgSecureLogin.
$wgServer may be either https or protocol-relative. If $wgServer starts with "http://", an exception will be thrown.
If a reverse proxy or CDN is used to forward requests from HTTPS to HTTP, the request header "X-Forwarded-Proto: https" should be sent to suppress the redirect.
In addition to setting this to true, for optimal security, the webserver should also be configured to send HTTP Strict Transport Security (HSTS) response headers.
When $wgForceHTTPS is set to false, HTTP/HTTPS preference is tracked on a per-user basis, by a combination of:
- the
prefershttpsuser preference - the cookie
forceHTTPSand session metadata (available viaSession::shouldForceHTTPS())- eventual PHP hooks changing session metadata (Manual:Hooks/SessionMetadata)
- the PHP method
Session::setForceHTTPS()
Availability
この変数は MediaWiki 1.35.0 (gerrit:608504) で追加されました。 この変数は MediaWiki 1.34.3 リリースの一部として、MediaWiki 1.34 にバックポートされました (gerrit:612497)。また、この変数は MediaWiki 1.31.9 リリースの一部として、MediaWiki 1.31 にバックポートされました (gerrit:615840)。