Solution under nginx where port 80 of the proxy server is blocked

  • 2020-05-06 12:11:46
  • OfStack

The method is as follows:

First of all, I have to prepare an VPS. I used a foreign one. This morning, I have finished the environment, so I can't wait to test it. ????? What? You environment do not know the configuration?? It doesn't matter. Read the tutorial, connect the terminal with SSH, and then execute the LNMP environment under centos one by one. Check out Centos for some basic commands, that's about it... . All right. That's pretty much it...


Then, we are 80 blocked. Let's give the website port 81, I said IIS, nginx and apache I really don't know how to give. . Then edit nginx.conf. Add the following before the last}... If you don't know how to add a site, see the article
above
 
server { 
listen 80; 
server_name jb51.cn www.jb51.cn; 
proxy_set_header X-Real-IP $remote_addr; 
proxy_set_header REMOTE-HOST $remote_addr; 
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 

access_log /home/www/logs/jb51.cn_access.log; 

location /robots.txt { 

root /home/www/www.jb51.cn; 

} 

location / { 

proxy_pass http://IP Or some other domain name :82; 

} 
} 

That's it. Easy... .

Related articles: