In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-20 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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.