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. 関連モジュール降順で並び替える タイトル
コンテンツの作成 7.50 Expanding Textareas Textareaフォームの行サイズを自動調整するモジュール
テーマ 7.56 field レンダリング配列内に「ラベル非表示」を指定する方法
コンテンツの管理 8.5.x Field File コンテンツのフィールドの表示について
サイトの構築 7.26 Field Views フォーム選択肢(プルダウンやチェックボックス、ラジオボタン)のカスタマイズ方法
コンテンツの作成 7.26 Form Ajax 入力フォームで#ajax使用時、#default_valueを書き換えても反映しない
コンテンツの作成 7.15 Form API Validation フォームの入力内容を細かくチェックしたい
Gmian 8.8.x Gmail Gmail:外部メールサーバー経由のメール送信ができなくなった場合の対処方法
タクソノミー 7.15 Hirarchical Select タクソノミー(ターム)の選択を楽にできないでしょうか
テーマ 7.23 hook ページや状況によってテーマを切り替える
テーマ 8.4x hook_preprocess_html bodyタグにnode idやaliasのClassを追加する方法
Views Exposed Filter 8.4x hook_views_pre_view Views Exposed Formの複数単語入力(textfield)をフォーム上だけ複数行入力(textarea)にする方法
Views 8.4x hook_views_query_alter Viewsクエリに多くの条件を追加する方法
Views 8.4x hook_views_query_alter 現在のViewsクエリを保存・再現する方法
Views 8.4x hook_views_query_alter Viewsクエリの条件式にサブクエリを追加する方法
言語 6.x i18n 多言語対応サイトのサイト名やスローガン/ミッションなどを多言語化する方法を教えてください
サイトの環境設定 7.23 Image Style 画像スタイルの使い方(Crop)
コンテンツの作成 7.50 Inline Entity Form Drupal6のフィールドグループのようなモジュールはありませんか?
コンテンツの作成 6.x Insert Block ブロックの内容を本文中に表示するには?
ユーザ 7.34 ip_ranges ログインアタック対策は?
GoogleMaps 7.28 Javascript IE9でGoogle Map APIを利用した住所情報所得がうまくゆかない

ページ