Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Can Apache be a reverse proxy?

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces whether Apache can do reverse proxy, the article is very detailed, has a certain reference value, interested friends must read it!

Reverse proxy (Reverse Proxy) means that the proxy server accepts the connection request on the internet, then forwards the request to the server on the internal network, and returns the result obtained from the server to the client requesting the connection on the internet. At this time, the proxy server behaves as a reverse proxy server.

It is mainly about the reverse proxy of Apache.

First, make sure that Apache has these modules, and confirm them in the Apache root directory, which mainly includes the following modules:

Mod_proxy.so

Mod_proxy_ajp.so

Mod_proxy_balancer.so

Mod_proxy_connect.so

Mod_proxy_http.so

Open the configuration conf/httpd.conf file and remove the comments for these modules, as shown in the following figure:

Modify the configuration file, open the file conf/httpd.conf, and add the following configuration at the end of the file:

# reverse proxy ProxyRequests OffProxyPass / clusterDemo http://127.0.0.1:8081/clusterDemoProxyPassReverse / clusterDemo http://127.0.0.1:8081/clusterDemo ProxyPass / clusterDemo2 http://127.0.0.1:8082/clusterDemo2ProxyPassReverse / clusterDemo2 http://127.0.0.1:8082/clusterDemo2 ProxyPass / clusterDemo3 http://127.0.0.1:8083/clusterDemo3ProxyPassReverse / clusterDemo3 http://127.0.0.1:8083/clusterDemo3#8888 is apache's listening port AllowOverride None Order Deny Allow Allow from all

test

Start apache and the corresponding tomcat.

Enter the address on the browser: http://127.0.0.1:8888/clusterDemo/index.jsp

Enter the address on the browser: http://127.0.0.1:8888/clusterDemo2/index.jsp

The application requested in the address bar can be accessed correctly to indicate that the reverse proxy request of Apache was forwarded successfully!

The above is all the content of whether Apache can do reverse proxy, thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report