Home >Backend Development >PHP Tutorial >nginx combines with tomcat to make a simple reverse proxy tomcat nginx apache wildfly installation and configuration nginx tomcat load balancing

nginx combines with tomcat to make a simple reverse proxy tomcat nginx apache wildfly installation and configuration nginx tomcat load balancing

WBOY
WBOYOriginal
2016-07-29 08:53:191229browse

1. Simple instructions

Install nginx on server 1, listen on port 80, ip: 192.168.56.201

Install tomcat on server 2, listen on port 8080

2. Modify nginx configuration

vi nginx.conf
<span style="font-family:Arial, Helvetica, sans-serif;">找到server一段,并在localtion最下面加入</span><span style="font-family: Arial, Helvetica, sans-serif;">proxy_pass http://192.168.56.202:8080;修改后的配置如下</span>
<span style="font-family: Arial, Helvetica, sans-serif;"> server {</span>
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   html;
            index  index.html index.htm;
            proxy_pass http://192.168.56.202:8080;
        }
3. Start nginx and follow on server 1 respectively Tomcat on server 2
4. Access http://192.168.56.201 with the browser. At this time, you can see that the page jumps to the familiar tomcat welcome page.

The above introduces nginx combined with tomcat to make a simple reverse proxy, including the content of tomcat and nginx. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn