nginx设置不同的域名访问到不同的端口上

配置conf下的nginx.conf文件 localhost 8088 dpa.xxx.com 8080 dcas.xxx.com 8090 具体的配置如下: server { listen 80; server_name dcas.xxx.com; location / { proxy_passhttp: //127.0.0.1:8090/; } } server { listen 80; server_name dpa.xxx.com; location / { proxy_passhttp: //127.0.0.1:8080/; } } server { listen 80; server_name localhost; location / { proxy_passhttp: //127.0.0.1:8088/; } } 重启一下我们的多个端口对应多个域名就起作用了。
联系我们

邮箱 626512443@qq.com
电话 18611320371(微信)
QQ群 235681453

Copyright © 2015-2022

备案号:京ICP备15003423号-3