简单的配置代理
# 在 http.conf中设置
#加载 mod_proxy.so
LoadModule proxy_module modules/mod_proxy.so
#设置代理
ProxyPass /xxx1 https://a.b.c/xxx2
ProxyPassReverse /yyy1 https://a.b.c/yyy2
AH01144
启动后访问服务遇到错误
AH01144: No protocol handler was valid for the URL /yyy1 (scheme 'https'). If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.
原因没有我访问的http服务,代理时也需要加载mod_proxy_http.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
AH01961 & AH00961
AH01961: SSL Proxy requested for localhost:80 but not enabled [Hint: SSLProxyEngine]
AH00961: HTTPS: failed to enable ssl support for 223.71.128.153:443 (yyy2)
如果是用于测试
,那么需要配置SSL,以忽略证书问题。
SSLProxyEngine On
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
最后完整的测试配置
# 在 http.conf中设置
#加载 mod_proxy.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
#设置代理
ProxyPass /xxx1 https://a.b.c/xxx2
ProxyPassReverse /yyy1 https://a.b.c/yyy2
SSLProxyEngine On
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off