現在、Apacheでリバースプロキシのサーバを立てており、その他のサーバ二台に中継しています。
リバースプロキシ自体は特に問題ないのですが、リバースプロキシに行く前にhttpで来た接続をhttpsにリダイレクトしたいと考えました。
上記をしないとhttpにアクセスした際に400のエラーメッセージが返却されるためです。
そこで以下のことについて質問したいと思います。
1.リバースプロキシ環境下でHTTPリクエストををHTTPSにリダイレクトする
環境については以下になります。
OS:CentOS 7.6
Apache httpd 2.4.6
試したこととしては/etc/httpd/conf.d/rewrite.conf
に以下の設定を入れてみました
<VirtualHost *:80> RewriteEngine on RewriteCond %{HTTPS} off RewriteRule ^/(.*)$ https://%{HTTP_HOST}/$1 [R=301,L] </VirtualHost>
その際コンソールには以下のエラーメッセージが出力されます
[root@localhost conf.d]# systemctl restart httpd Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
/var/log/httpd/error_log
には以下の出力があります
[Sun May 19 06:49:57.647722 2019] [suexec:notice] [pid 16327] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Sun May 19 06:49:57.651694 2019] [ssl:emerg] [pid 16327] AH01892: Illegal attempt to re-initialise SSL for server (SSLEngine On should go in the VirtualHost, not in global scope.) [Sun May 19 06:49:57.651725 2019] [ssl:emerg] [pid 16327] AH02312: Fatal error initialising mod_ssl, exiting.
ご教示いただけますと幸いです。
以上、よろしくお願いいたします。
回答1件
あなたの回答
tips
プレビュー