配置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/;
}
}
重启一下我们的多个端口对应多个域名就起作用了。