简体   繁体   English

将HTTP服务器放在Apache https代理后面

[英]Serve http server behind an Apache https Proxy

It seems that it is possible to get Apache server to Proxy and Manage SSL handshake on https requests and service them as 'http' thru another server behind it. 似乎有可能使Apache服务器能够对https请求进行代理和管理SSL握手,并将它们作为“ http”通过其后的另一台服务器进行服务。

I have configured an apache server for ProxyPass using following configuration 我已经使用以下配置为ProxyPass配置了apache服务器

SSLProxyEngine On
ProxyPass / http://localhost:8081/
ProxyPassReverse / http://localhost:8081/

I am able to get all all traffic to the apache server that is listening to port 8080 direct and serve by the localhost:8081 server so 我能够获得所有直接访问端口8080的apache服务器的流量,并由localhost:8081服务器提供服务,因此

http://localhost:8080/hi is being correctly served by http://localhost:8081/hi

However the following does not work : 但是以下方法不起作用:

http**s**://localhost:8080/hi to be served by http://localhost:8081/hi

Apache is trying to pass the https:// traffic to the 8081 server, without managing the SSL handshake. Apache尝试将https://流量传递给8081服务器,而不管理SSL握手。

Your Apache listener on port 8080 is an http listener, not an https listener. 端口8080上的Apache侦听器是http侦听器,而不是https侦听器。 You can't handle both types of traffic on the same port. 您不能在同一端口上处理两种类型的流量。 If you want to handle SSL traffic, you'll need to set up a new context on another port with SSLEngine On and all the other normal SSL configuration (certificate, key, etc). 如果要处理SSL流量,则需要使用SSLEngine On以及所有其他常规SSL配置(证书,密钥等)在另一个端口上设置新上下文。

This question has one version of this configuration. 该问题具有此配置的一个版本。

Also this post . 也是这个帖子

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM