I installed and configure an Apache Web Server as a Reverse Proxy on CentOS 8. I created a Virtual Host file (reverse_proxy.conf) under the "/etc/httpd/conf.d" directory with below content:
Code: Select all
<VirtualHost *:80>
ProxyPreserveHost On
ProxyPass / http://192.168.1.20/
ProxyPassReverse / http://192.168.1.20/
</VirtualHost>
I want this Reverse Proxy Server service to more than websites:
Code: Select all
The Internet ---> Apache Reverse Proxy ---> Web Server 1
---> Web Server 2
I created another Virtual Host config file for other websites:
The content of reverse_proxy1.conf file is:
Code: Select all
<VirtualHost *:80>
ServerName Website1
ProxyPreserveHost On
ProxyPass / http://192.168.1.20/
ProxyPassReverse / http://192.168.1.20/
</VirtualHost>
Code: Select all
<VirtualHost *:80>
ServerName Website2
ProxyPreserveHost On
ProxyPass / http://192.168.1.4/
ProxyPassReverse / http://192.168.1.4/
</VirtualHost>
I checked log file and it show me:Service Unavailable
Why it just see "reverse_proxy1.conf" file?# cat /var/log/httpd/error_log
[Wed Mar 17 01:12:44.817647 2021] [proxy:error] [pid 28599:tid 28649] (113)No route to host: AH00957: HTTP: attempt to connect to 192.168.1.20:80 (192.168.1.20) failed
[Wed Mar 17 01:12:44.817775 2021] [proxy_http:error] [pid 28599:tid 28649] [client 10.0.3.2:52142] AH01114: HTTP: failed to make connection to backend: 192.168.1.20
Thank you.