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.15 Devel 簡単に指定ユーザにログインしなおす方法
コンテンツの管理 8.9.x Dialog Modal Canvas drupal 8 の標準機能のダイアログ/ポップアップを表示する方法
Messages 7.34 Disable messages 標準(コア)が表示する特定のメッセージ非表示にしたい
アップデート 7.28 DisableMessages モジュールのアップデートガイダンスを非表示にしたい
コンテンツの作成 8.9.x Display sweet, Views, Twig Tweak, Views field formatter テーマに頼らず コンテンツのフィールドとしてViewsを埋め込み表示する方法
アップデート 7.34 Distribution(Commerce Kickstart) drushでcommerce_kickstartのアップデートに失敗する
コンテンツの作成 8.4x Download とにかく何でもコンテンツをダウンロードさせる方法
アップデート 7.50 Download count DOWNLOAD MODULEページでダウンロードが失敗することがある
サイトの構築 7.59 Drupal.ajax drupal 7 で Uncaught TypeError: Drupal.ajax is undefined となったときの対応方法
drush 7.54 Drush Drushでdrupalサイトをインストールする方法
PHP 8.9.x drush drush sql:cli < が機能しない場合の対処
Migrate 9.x drush config Upgrade source(環境) を 変更したときにやるべきこと
サイトの構築 7.34 ECK Entityの使い方について
コンテンツの管理 8.4x Entity EntityをPropertyで探す(クエリする)方法
言語 7.15 Entity Translation 各フィールドのラベルの多言語切り替え漏れ(フィールド・ラベル)
言語 7.15 Entity Translation nodeのEntity Translation
言語 7.14 Entity Translation 各フィールドのラベルの多言語切り替え漏れ(接頭子、接尾子)
言語 7.15 Entity Translation デフォルトの言語 - Entity Translation
コンテンツの作成 7.34 Entityreference prepopulate 新規ノード作成時のリファレンス方法
タクソノミー 7.15 Entity_Trarnslation Taxonomy TaxonomyのEntity Translation

ページ