Apache2.4 から httpsサーバーへリバースプロキシする方法

カテゴリ リバースプロキシ コアバージョン 8.9.x 関連モジュール mod_proxy mod_proxy_http mod_ssl

ドメイン「proxy-domain.com」において
・パス「/sub/〜」 の ときのみ 「sub-domain.com/sub/〜」 に
・そのほかのパスのときは「main-domain.com/〜」に
リバースプロキシするには

  • mod_ssl を有効にする
  • mod_proxy を有効にする
  • mod_proxy_http を有効にする

「main-domain.com」側の httpd.conf 等に 以下の記述を追加する

        ProxyRequests off
        SSLProxyEngine on
        <Location />
                ProxyPass https://main-domain.com/
                ProxyPassReverse https://main-domain.com/
                ProxyPassReverseCookieDomain main-domain.com proxy-domain.com
                ProxyPassReverseCookiePath / /
                RequestHeader unset Accept-Encoding
                AddOutputFilterByType SUBSTITUTE text/plain text/html application/javascript text/javascript
                Substitute "s|httsp://main-domain.com/|https://proxy-domain.com/|q"
        </Location>
        <Location /en/>
                ProxyPass https://sub-domain.com/en/
                ProxyPassReverse https://sub-domain.com/en/
                ProxyPassReverseCookieDomain sub-domain.com proxy-domain.com
                ProxyPassReverseCookiePath / /en/
                RequestHeader unset Accept-Encoding
                AddOutputFilterByType SUBSTITUTE text/plain text/html application/javascript text/javascript
                Substitute "s|https://sub-domain.com/en/|https://proxy-domain.com/en/|q"
        </location>

OTHER FAQ

Drupal開発・運用の疑問/質問の答えはここに

無料ユーザー登録すると質問できます。

カテゴリ Core Ver.昇順で並び替える 関連モジュール タイトル
フォーム 8.9.x Views Views exposed filterのフォームに#default_valueを仕込む方法
コンテンツの管理 8.9.x Dialog Modal Canvas drupal 8 の標準機能のダイアログ/ポップアップを表示する方法
PHP-FPM 8.9.x PHP PHP-FPM 環境で .htaccess に php_value を 書いてもダメ
コンテンツの作成 8.9.x CKEditor CKEditor編集中の見た目をフロントと全く同様にする方法
PHP 8.9.x PHP YamlをPHP配列にする方法
コンテンツの作成 8.9.x node ノード保存時の前回値の参照方法
Gmian 8.8.x Gmail Gmail:外部メールサーバー経由のメール送信ができなくなった場合の対処方法
アップデート 8.8.x Composer composer updateが異常終了する
ログイン 8.7.x System ユーザー アカウントロックの範囲設定
フォーム 8.7.x Webform WebformのCheckboxの要素にて表記の変更
テーマ 8.7.x Bartikのtwigについて
mac linux ファイル名 文字化け 8.7.x mac linux ファイル名 文字化け Macからlinuxにrsyncするとファイル名(濁点)が文字化けする場合の対応方法
コンテンツの作成 8.7.x CkEditor CKEditorエディタ内に Colorboxポップアップ を簡単に挿入する方法
アップデート 8.7.2 menu drupal-core 8.7.2にupdateしたところ
フォーム 8.6.x JavaScript 特定のformにJavaScriptを紐付ける方法
Viewsプログラミング 8.6.x Views Drupal8 Viewsの動的キャッシュをクリアする方法
Commerce2 8.6.x Commerce Shipment Commerceで配送情報を得る方法
サイトの環境設定 8.6.x Simhony Yaml yamlファイルを読み込む方法
Commerce2 8.6.x Commerce Order Commerceで注文情報から全Itemを得る方法
コンテンツの管理 8.6.x Commerce Commerce orderからすべての商品名を取得する方法

ページ