Linux Server

apacheでのリバースプロキシ構築(SSL編)

  

ご注意下さい

この記事は3年以上前に書かれた記事ですので、内容が古い可能性があります。

1.6
(5)
前回のapacheでのリバースプロキシ構築の続編です。 今度はバックエンド側でHTTPSのホームページがある場合になります。 この場合クライアント~フロントエンドまではHTTPS(443/tcp)で通信し、フロントエンド~バックエンドはHTTP(80/tcp)で通信する設定となります。つまり、フロントエンドのリバースプロキシにSSLアクセラレータの機能を持たせることになります。 設定についてはそんなに難しくなく、昔むかーしに記事にした、Apache + SSL を見てリバースプロキシ側に証明書を作成します。 /etc/httpd/conf.d/ssl.confは前回のようにVirtualHostディレクティブ内にProxyの設定を記載します。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
(省略)
<VirtualHost 192.168.xx.xx:443>
 
ErrorLog logs/ssl_error_log
TransferLog logs/ssl_access_log
LogLevel warn
 
SSLEngine on
SSLProtocol all -SSLv2
 
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
 
SSLCertificateFile /etc/httpd/conf/ssl.crt/example.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/example.key
 
<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"
 
ProxyPreserveHost On
ProxyPass /
ProxyPassReverse /
ServerName example.com
ServerAlias *.example
 
</VirtualHost>
あと、/etc/httpd/conf/httpd.conf内の以下の部分についても追記して同一サーバ上でHTTPSもハンドリングできるように設定が必要です。
1
2
3
4
5
6
7
8
9
10
11
12
#
# Use name-based virtual hosting.
#
#NameVirtualHost *:80
#
# NOTE: NameVirtualHost cannot be used without a port specifier
# (e.g. :80) if mod_ssl is being used, due to the nature of the
# SSL protocol.
#
NameVirtualHost 192.168.xx.xx:80
NameVirtualHost 192.168.xx.xx:443
#
これでOKなはずです。

この記事は役に立ちましたか? | Is this article useful for you?

評価をお願いします | Please leave your rating.

平均 | Av.: 1.6 / 5. 投票数 | Votes: 5

最初の評価を下さい | Please vote for the first rating.

-Linux Server
-, ,

S