Let's first understand a wave of concepts, what is nginx reverse proxy? Reverse proxy means using a proxy server (here nginx) to receive requests on the network, that is, URL (the default is port 80). 1. Nginx makes some judgments on the URL (the forwarding rules are configured in the nginx configuration file), such as the port number (the default value of nginx is 80), which may be the secondary domain name. For example, test1.baidu.com and test2.baidu.com are two second-level domain names. The first-level domain name here is baidu.com. DNS will resolve these two domain names to the same IP ( you need to add second-level domain name resolution (Alibaba Cloud needs to add resolution in domain name resolution. Different domain names can be resolved to the server with the same IP), or they can be resolved to different IPs separately ) 2. After nginx is configured as a reverse proxy, it can forward requests for different secondary domain names to different ports or IPs and ports that can provide corresponding services. That is to say, you enter test1.baidu.com in your browser test2.baidu.com and press Enter. The actual access port (or IP, which depends on the configuration of the forwarding rules in your nginx) is different, and the service obtained is also different (this is the project in the nginx configuration file that forwards requests to different IPs and ports according to different domain names or request paths); Let's take a screenshot online: client: It is the client browser, which can be a mobile browser or a PC browser That blue cloud is the Internet Reverse proxy server: server configured with nginx Web server, file server --- Tomcat or other containers (with web projects deployed) that provide services. These servers are usually in the same LAN. To put it simply, the external network accesses the same port (80), which is forwarded to different ports on the internal network that provide different services through nginx. Does this mean that we only need to open port 80 and can close port 8080? I went to Alibaba Cloud to test it: After shutting down 8080, Modify the default.conf file of nginx After wq saves the changes, start nginx: service nginx restart That's it. The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: RHEL7.5 mysql 8.0.11 installation tutorial
>>: Summary of how to use bootstrap Table
During the daily optimization process, I found a ...
Detailed explanation of Linux vi command The vi e...
What I have been learning recently involves knowl...
Table of contents 1. Introduction: 2. The first i...
The virtual machine I rented from a certain site ...
This article shares the specific code of Vue to i...
Table of contents In vue2 In vue3 Notes on setup ...
I mainly introduce how to develop a lucky wheel g...
First install ssh in Linux, taking centos as an e...
Preface Slow query log is a very important functi...
I have encountered many centering problems recent...
MySQL prompts the following error I went to "...
It's the end of the year and there are fewer ...
You may encounter the following problems when ins...
Docker allows network services to be provided by ...