In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "nginx how to configure multiple tomcat to share 80 ports", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how to configure multiple tomcat to share port 80".
Scenario: project 1 is placed in tomcat1, Project 2 is placed in tomcat2, two tomcat are placed on the same server, and port 80 access needs to be shared.
Note: this is different from cluster deployment, where a project is placed in multiple tomcat.
Here the reverse proxy is done through nginx. Please download nginx from http://nginx.org/en/download.html.
Modify the server in conf/nginx.conf as follows:
Server {listen 80; server_name 192.168.1.197; # charset koi8-r; # access_log logs/host.access.log main; location / {root html; index index.html index.htm;} # plus the following configuration location / server1 {proxy_pass http://192.168.1.197:8081/server1; # mainly here, this is the tomcat1 port and project proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 100m; root html; index index.html index.htm;} location / server2 {proxy_pass http://192.168.1.197:8082/server2; # mainly here, this is the tomcat2 port and project proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 100m; root html; index index.html index.htm;}
Well, at this point, you can access the service using http://192.168.1.197/server1 and http://192.168.1.197/server2 respectively.
At this point, I believe you have a deeper understanding of "how to configure multiple tomcat shared 80 ports in nginx". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.