2015年5月29日 星期五

Apache Reverse設定筆記-支援 https 不使用 url rewrite

環境: 
Proxy Server: Apache/2.2.15 (CentOS)
Web Server: Apache/2.2.15 (CentOS) 192.168.1.1

說明:
https://Reverse/i     Reverse 至  https://192.168.1.1:895/i/

Proxy Server 安裝軟體
yum install  mod_ssl openssl

編輯 Proxy Server /etc/httpd/conf/httpd.conf 加入
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so

LoadModule ssl_module modules/mod_ssl.so
SSLProxyEngine On

<Directory /i >
   AllowOverride none
    Require all denied
 </Directory >

ProxyPass /i/ https://192.168.1.1:895/i/
ProxyPassReverse /i/ https://192.168.1.1:895/i/

192.168.1.1 apache log 修改設定支援 X-Forwarded

修改  /etc/httpd/conf/httpd.conf

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy
SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded
CustomLog "logs/access_log" combined env=!forwarded
CustomLog "logs/access_log" proxy env=forwarded

沒有留言: