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.22 Realname ユーザーIDではなくニックネーム等を表示したい
ユーザ 7.44 Quickbar 会員の種別(役割)別にメニューを設けたい
SSH 7.50 ProxyCommand SSH IP制限を1コマンドで通過する
Proxy 7.59 Proxy Apache settings.php リバースプロキシ(Apache)+バックグランドWeb(Drupal 7 )でログインセッションを維持する方法
サイトの構築 7.19 Plesk Pleskでdrupal7(プライベートファイルシステム)を使う場合の注意点
コンテンツの作成 8.4x PhpSpreadsheet Excelを読み書きする方法
PHP 8.9.x PHP YamlをPHP配列にする方法
Database 7.34 PHP データベースクエリ(SELECT)時のSQL関数
PHP 7.22 PHP ノードに付いたコメントを好きな場所に表示する
コンテンツの作成 7.26 PHP ノード内の一部(フィールド)を変更する
アップデート 8.9.x PHP CentosでPHPのバージョンアップ(例:5.3->5.6)を行う方法
ユーザ 7.23 PHP user_load_multiple()の復帰値
ユーザの管理 7.27 PHP 新規ユーザーの追加ができない
JavaScript 8.5.x PHP Commerce決済モジュール設定をJavaScriptにデータに渡す方法
コンテンツの管理 7.16 PHP 好きなところにノードを埋め込みたい
JavaScript 7.34 PHP PHPからJavaScriptに変数値を渡したい
PHP 8.3x PHP drupa8でhook_init()する方法
チューニング 7.26 PHP DrupalはNginxで動く?
PHP-FPM 8.9.x PHP PHP-FPM 環境で .htaccess に php_value を 書いてもダメ
ユーザの管理 7.50 Paypal continued billing drupal7のPaypal継続課金モジュールについて

ページ