First make sure that tomcat has been installed on this machine and uses the default port 8080.
--install nginx
1. yum install gcc-c++
2. yum install pcre pcre-devel
3. yum install zlib
4. yum install openssl openssl-devel
5. yum install nginx
--Configure nginx
vim /etc/nginx/nginx.conf
Find the empty location brackets in the Server brackets, and fill in the location segment as follows
location / {
root html;
index index.html index.htm;
proxy_pass http://localhost:8080
}
Save the changes you just made.
--start nginx
service nginx start
-- test reverse proxy
Use the mobile browser to enter the server's external network IP address and press Enter, and the tomcat welcome page appears.