Centos 7 builds nginx domain name-based reverse proxy

Experimental environment: one centos 7 (ngindx 192.168.80.150) one windows server 2019 (web service 192.168.80.222)
win 7 (client)

The first step is to create a .conf configuration file in the /etc/nginx/conf.d/ directory with a customized name.

Insert image description here
In the second step, write the following command.

upstream web1 {
    
    
         server 192.168.80.222;
}

server {
    
    
       listen 80; 
       server_name www.pip.cc;
       location / {
    
     
                proxy_pass http://web1;
       }   
}

Insert image description here
The third step is to build a website in Windows Server 2019 and configure the homepage.

Insert image description here

(Note that there is no need to build a dynamic dns, we only need to build a static dns)

The fourth step is to modify the hosts file under the c drive

C:\Windows\System32\drivers\etc

Insert image description here
Just write the following command.

Step 5, ping test

Insert image description here
The sixth step is to access via win 7 browser.Insert image description here

Guess you like

Origin blog.csdn.net/qq_51235445/article/details/125244464
Recommended