初めて質問させていただきます。
apache、リバースプロキシ、SSL、nginxの
記述方法について不明点がありご質問させていただきます。
■サーバー構成
下記のような構成でサイトを運営していて
SSL化込みのリバースプロキシの設定を行ったのですがうまくいかず途方にくれております。
①https://example.com/
②http://example.com/aaa/
①・・・apache2.2、CentOS6.7
②・・・nginx1.9、CentOS7
②はWordPressを使用しており、負荷分散のため今後は
リバースプロキシでaaaディレクトリを別サーバーで運営をしたいと思っております。
サーバーはKUSANAGI(https://kusanagi.tokyo/)を使用しています。
こちらの設定は殆どデフォルトのまま使用しています。
同時に②はSSL化したいと思っており、下記のように設定しました。
WordPress側のwp_optionsのsiteurlおよびhomeはhttpsに書き換えました。
(https://example.com/aaa/ に設定しています。)
■質問点
(1)ここで、http://example.com/aaa/ と http://②用のIP/でアクセスが来た場合、
https://example.com/aaa/ に常時リダイレクトさせたいと思っているのですが書き方がわかりません。
そのためhttps://example.com/aaa/ とhttp://example.com/aaa/ が両方混在している状態になっております。
(2)②のサーバーのSSL化について
②のサーバーにおSSLの設定は必要なのでしょうか。①のサーバーで設定しているため、不要だと勝手に思っております。
上記2点の質問についてご質問させていただきます。
長文乱文で大変申し訳ございませんが、ご教示いただけましたら幸甚で御座います。
お手数をおかけしますが、よろしくお願い致します。
■以下WEBサーバーの設定
①httpd.conf
Listen 80 ~省略~ NameVirtualHost *:80 <VirtualHost *:80> DocumentRoot /var/www/example.com ServerName example.com </VirtualHost> <IfModule mod_proxy.c> ProxyRequests Off <Proxy *> Order deny,allow Allow from All </Proxy> ProxyPass /aaa/ http://②用のIP/aaa/ ProxyPassReverse /aaa/ http://②用のIP/aaa/ </IFModule>
①ssl.conf
LoadModule ssl_module modules/mod_ssl.so Listen 443 SSLPassPhraseDialog builtin SSLSessionCache shmcb:/var/cache/mod_ssl/scache(512000) SSLSessionCacheTimeout 300 SSLMutex default SSLRandomSeed startup file:/dev/urandom 256 SSLRandomSeed connect builtin SSLCryptoDevice builtin <VirtualHost _default_:443> DocumentRoot "/var/www/example.com/" ServerName example.com:443 LogLevel warn SSLEngine on SSLProtocol all -SSLv2 SSLCipherSuite DEFAULT:!EXP:!SSLv2:!DES:!IDEA:!SEED:+3DES SSLCertificateFile /usr/local/ssl/certs/○○○ SSLCertificateKeyFile /usr/local/ssl/private/○○○ SSLCACertificateFile /usr/local/ssl/certs/○○○ <Files ~ "\.(cgi|shtml|phtml|php3?)$"> SSLOptions +StdEnvVars </Files> <Directory "/var/www/cgi-bin"> SSLOptions +StdEnvVars </Directory> SetEnvIf User-Agent ".*MSIE.*" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0 CustomLog logs/ssl_request_log \ "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" </VirtualHost> <IfModule mod_proxy.c> ProxyRequests Off <Proxy *> Order deny,allow Allow from All </Proxy> SSLEngine on SSLProxyEngine on ProxyPass /aaa/ https://②用のIP/aaa/ ProxyPassReverse /aaa/ https://②用のIP/aaa/ </IFModule>
②httpd.conf
server { listen 80; server_name ②のIP; 省略
②ssl.conf
server { listen 443; server_name ②のIP; 省略

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/05/31 03:24
2016/05/31 04:05
2016/05/31 05:33