问题原文
原帖链接 · wouter205 · CC BY-SA 4.0
I want to forward a request from one server to another. Here is my problem:
hr.example.com- port 80 - Server Asupport.example.com- port 80 - Server B
All requests on port 80 are forwarded to Server A by the firewall.
So, I want requests for support.example.com to be forwarded from server A to server B. How can I achieve this with Apache?
I followed the answer from here. I added the following code to my apache.conf on Server A but it results in a "500 internal server error".
<VirtualHost *:80>
ServerName support.example.com
LoadModule proxy_module modules/mod_proxy.so
ProxyRequests Off
<Proxy *>
Require all granted
</Proxy>
ProxyPass / http://IP-ADDRESS-SERVER-B:80/
ProxyPassReverse / http://IP-ADDRESS-SERVER-B:80/
<Location />
Require all granted
</Location>
</VirtualHost>
Note: Server A is Windows server 2012 with Apache 2.4
How should I forward these requests properly please?
已采纳解答
原帖链接 · wouter205 · CC BY-SA 4.0
Thanks @MrWhite for giving the correct configuration.
I needed extra module mod_proxy_http and to change the IP adress of server-B to the hostname as I have multiple vHosts on :80.
Here is the working configuration:
<VirtualHost *:80>
support.example.com
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
ProxyRequests Off
<Proxy *>
Require all granted
</Proxy>
ProxyPass / http://support.example.com:80/
ProxyPassReverse / http://support.example.com:80/
<Location />
Require all granted
</Location>
</VirtualHost>
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
