LoginSignup
0
2

More than 3 years have passed since last update.

RHEL7 apache httpd proxy設定整理

Last updated at Posted at 2019-09-29

参考URL

構成

・ネットワーク構成
client ⇒[https]⇒ proxy ⇒[https]⇒ server

・証明書構成
proxy用-CA ①
├ proxy用-サーバ証明書 ②
└ proxy用-秘密鍵 ③

server用-CA ④
├ server用-サーバ証明書 ⑤
└ server用-秘密鍵 ⑥

・ソフトウェア構成
client
└ Windows

proxy
├ RHEL7.5
└ apache 2.4(httpd-2.4.6-80.el7.x86_64)

client
├ RHEL7.5
└ apache 2.4(httpd-2.4.6-80.el7.x86_64)

設定

抜粋して記載

Client

proxy用-CA ①をインストール

Proxy

/etc/httpd/conf.d/ssl.conf
ProxyRequests off
SSLProxyEngine on
SSLProxyVerify require #proxy⇒serverのサーバ認証無視させない

ProxyPass / https://server01b.rhel.local/
ProxyPassReverse / https://server01b.rhel.local/

SSLCertificateFile /root/ssl.crt #proxy用-サーバ証明書 ②
SSLCertificateKeyFile /root/ssl.key #proxy用-秘密鍵 ③
SSLProxyCACertificateFile /root/ca.crt #server用-CA ④

Server

/etc/httpd/conf.d/ssl.conf
SSLCertificateFile /root/ssl.crt #server用-サーバ証明書 ⑤
SSLCertificateKeyFile /root/ssl.key #server用-秘密鍵 ⑥

SSLProxyCACertificateFile を忘れそうだったので、メモ。

ReverseProxy構成にて、X-Forwarded-Forの値によって接続拒否設定

2.2系での手法

http.conf
<Location "/">
  SetEnvIf X-Forwarded-For '172.16.0.40' deny_ip
  SetEnvIf X-Forwarded-For '172.16.0.41' deny_ip
  order deny,allow
  deny from env=deny_ip
</Location>

2.4系での手法

http.conf
RemoteIPHeader X-Forwarded-For
RemoteIPInternalProxy 172.0.0.0/8
<Location "/">
    <RequireAll>
    Require all granted
    Require not ip 172.16.0.40
    </RequireAll>
</Location>

ReverseProxy構成、Virtualhostの理解

http.conf
<VirtualHost Proxy01:443> ※リッスンホスト名:Port番号
  ServerName hogehoge.co.jp:443 ※リクエストURL名:Port番号
  :
  <snip>
  :
</VirtualHost>

<VirtualHost Proxy01:443> ※リッスンホスト名:Port番号
  ServerName usausa.co.jp:443 ※リクエストURL名:Port番号
  :
  <snip>
  :
</VirtualHost>
0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2