Article 5FE52 An Apache Reverse Proxy Server to service more than web sites.

An Apache Reverse Proxy Server to service more than web sites.

by
n00b_noob
from LinuxQuestions.org on (#5FE52)
Hello,
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:<VirtualHost *:80>
ProxyPreserveHost On
ProxyPass / http://192.168.1.20/
ProxyPassReverse / http://192.168.1.20/
</VirtualHost>It's worked.
I want this Reverse Proxy Server service to more than websites:
Code:The Internet ---> Apache Reverse Proxy ---> Website 1
---> Website 2I have a question. For each website I need a Virtual Host config file or I can put all websites configuration in one virtual Host file?

I created another Virtual Host config file for other websites:

The content of reverse_proxy1.conf file is:
Code:<VirtualHost *:80>
ServerName Website1
ProxyPreserveHost On
ProxyPass / http://192.168.1.20/
ProxyPassReverse / http://192.168.1.20/
</VirtualHost>The content of reverse_proxy2.conf file is:
Code:<VirtualHost *:80>
ServerName Website2
ProxyPreserveHost On
ProxyPass / http://192.168.1.4/
ProxyPassReverse / http://192.168.1.4/
</VirtualHost>But when I browse my Reverse Proxy Server then it can't handle the requests and show me below error:
Quote:
Service Unavailable
I checked log file and it show me:
Quote:
# 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
Why it just see "reverse_proxy1.conf" file?

Thank you.latest?d=yIl2AUoC8zA latest?i=KvLlaRvMgak:OoFByULwPCk:F7zBnMy latest?i=KvLlaRvMgak:OoFByULwPCk:V_sGLiP latest?d=qj6IDK7rITs latest?i=KvLlaRvMgak:OoFByULwPCk:gIN9vFwKvLlaRvMgak
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments