1. PreparationInstall Tomcat on Linux system, use the default port 8080, and start the Tomcat server Can be accessed normally Next, we want to forward the request to the Tomcat server through the Nginx reverse proxy. The port number of the Nginx reverse proxy server is exposed to the outside, while Tomcat is not exposed to the outside. The browser cannot access Tomcat directly, but can only access Tomcat through the Nginx reverse proxy server 2. Reverse proxy configurationConfigure the mapping between domain name and IP address in the hosts file of Windows system You can access the Tomcat server through the domain name port 8080 Then configure request forwarding in Nginx and configure reverse proxy At this time, port 8080 is not accessed, but the Nginx proxy server is directly accessed. Nginx will reverse the proxy and forward the request to the Tomcat server on port 8080. You can also configure Nginx's reverse proxy to jump to services on different ports based on different access paths. First, start two Tomcat servers with different ports, one configured with port 8081 and the other with port 8082. Start two Tomcat servers At this point, ports 8081 and 8082 are both accessible Configure Nginx reverse proxy server After configuring the reverse proxy, access the file8081 page under the /test8081/ path. Nginx will use the reverse proxy to access the Tomcat server on port 8081. Visit the file8082 page under the /test8082/ path, Nginx will reverse proxy to access the Tomcat server on port 8082 This allows requests to be forwarded to different servers through reverse proxies based on different access paths. SummarizeThis is the end of this article about Nginx reverse proxy configuration. For more relevant Nginx reverse proxy configuration content, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Understand the basics of Navicat for MySQL in one article
>>: How to use html table (to show the visual effect of web page)
Table of contents Pygame functions used Creating ...
Table of contents 1. useState hook 2. useRef hook...
Original link https://github.com/XboxYan/no… A bu...
The final result is like this, isn’t it cute… PS:...
When we write pages, we sometimes find that the C...
The meta tag is used to define file information an...
conda update conda pip install tf-nightly-gpu-2.0...
Before talking about CSS priority, we need to und...
Anyone who has a little knowledge of data operati...
illustrate: There are two main types of nginx log...
Table of contents Vite project build optimization...
This article shares the specific code of jQuery t...
How to quickly copy a table First, create a table...
Container is another core concept of Docker. Simp...
In the course of work, you will encounter many ca...