阿里云二级域名解析指向服务器另一台主机— —Nginx

  
这是在一台阿里云服务器没有任何域名,但是配置高,因此想借用另一台阿里云服务器(配置较低)已备案的域名 跳转到这台配置高的服务器,那么使用nginx反向代理

server { listen 80; server_name wxapi.exampile.com; //另一台阿里云服务器已备案的域名 root /home/soft/dist; # Load configuration files for the default server block. include /etc/nginx/default.d/*.conf; location / { } location /api { proxy_pass http://427.125.114.42:8888; //本台服务所运行的程序地址 } location /login{ proxy_pass http://427.125.124.412:8888; } location /xcx { proxy_pass http://427.122.104.412:8888; } error_page 404 /404.html; location = /40x.html { } error_page 500 502 503 504 /50x.html; location = /50x.html { } }

配置低的阿里云服务器配置:

参考一下:https://blog.csdn.net/visiontime/article/details/70880388

猜你喜欢

转载自www.cnblogs.com/Amos-Turing/p/10943998.html