GoDaddy 도움말

How to set up a reverse proxy

A proxy is an application that processes resource requests between client computers and servers. A reverse proxy retrieves those resources from the servers on behalf of the clients, just as if the resources came directly from the servers.

Reverse proxies have a variety of specific applications, especially for web servers. A single computer may need to run multiple web servers where each server listens to incoming service requests on a different port. A reverse proxy can then analyze each request and deliver it to the appropriate server. For example, a CentOS computer running Apache and Tomcat servers can use a reverse proxy to allow Tomcat to request resources from Apache.

DIFFICULTY Basic - 1 | Medium - 2 | Advanced - 3
RELATED PRODUCTS Linux-based VPS or dedicated servers

Here is a quick tutorial on how to setup a reverse proxy between an Apache web server and a Tomcat server. If you need any help setting up Tomcat, see How to install Apache Tomcat.

Start the servers

Use the following commands to start Apache and Tomcat from the command line if they aren't already running:

# start httpd.service
# sudo $CATALINA_HOME/bin/

These commands should provide the following output:

Modify httpd.conf

Use nano to modify the httpd.conf, which is typically located in /etc/httpd/conf. Add the following lines to httpd.conf in the indicated section for loading modules:

LoadModule proxy_module modules/
LoadModule proxy_http_module modules/
# mod_proxy setup.
ProxyRequests Off
ProxyPass /test http://localhost:8080
ProxyPassReverse /test http://localhost:8080
<Location "/test">
  Order allow,deny
  Allow from all

The above lines will create the reverse proxy to the Tomcat server from http://localhost/test, assuming that Tomcat is listening to the default port of 8080.

Save httpd.conf, which should now appear similar to the following screenshot:

Test the reverse proxy

Enter http://localhost/test in your browser. You should see the default Tomcat homepage as follows:

이 글이 도움되었나요?
피드백을 보내주셔서 감사합니다. 고객 서비스 담당자에게 문의하시려면 지원 전화 번호 또는 위의 채팅 옵션을 이용하시기 바랍니다.
도와드릴 수 있어 기쁩니다! 더 도와 드릴 것이 있나요?
그것 유감스럽습니다. 혼동이 되었던 사항 또는 솔루션이 고객님의 문제를 해결하지 못했던 원인을 알려주세요.