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
Release: 2016-07-29 08:53:19
Original
1221 people have browsed it

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
Copy after login
<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>
Copy after login
<span style="font-family: Arial, Helvetica, sans-serif;"> server {</span>
Copy after login
        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;
        }
Copy after login
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.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template