1.域名转发,用途:A:本服务器绑定域名,B:转发地址不必是本服务器,用途可实现动态域名解析
server { listen 80; server_name www.5211.com; location / { proxy_pass http://39.107.237.3; } }
2. https://blog.csdn.net/weixin_41585557/article/details/82426784
server { listen 80; server_name 001.tanlin.375211.net; location / { proxy_pass http://localhost:7077; proxy_set_header Host $http_host; //应用可以获取到 001.tanlin.375211.net } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } }
默认绑定所有主域名
listen 80; server_name localhost;
listen 80;
server_name localhost;