Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net Asp Net Core Nginx多域的重复侦听错误_Asp.net_Linux_Asp.net Core_Nginx - Fatal编程技术网

Asp.net Asp Net Core Nginx多域的重复侦听错误

Asp.net Asp Net Core Nginx多域的重复侦听错误,asp.net,linux,asp.net-core,nginx,Asp.net,Linux,Asp.net Core,Nginx,我正在尝试在Linux上托管多个具有不同域的ASP NET核心站点,卸载18.04并使用nginx作为反向代理 我得到的错误是“80的重复监听选项”。此错误的原因是什么?如何解决此错误 默认的nginx配置为: server { listen 80; server_name domain1.com www.domain1.com; location / { proxy_pass http://localhost:5000;

我正在尝试在Linux上托管多个具有不同域的ASP NET核心站点,卸载18.04并使用nginx作为反向代理

我得到的错误是“80的重复监听选项”。此错误的原因是什么?如何解决此错误

默认的nginx配置为:

server {

    listen 80;

    server_name domain1.com www.domain1.com;

    location / {
            proxy_pass         http://localhost:5000;
            proxy_http_version 1.1;
            proxy_set_header   Upgrade $http_upgrade;
            proxy_set_header   Connection keep-alive;
            proxy_set_header   Host $host;
            proxy_cache_bypass $http_upgrade;
            proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header   X-Forwarded-Proto $scheme;
    }

}

server {

    listen 80;

    server_name domain2.com domain2.com;

    location / {
            proxy_pass         http://localhost:5005;
            proxy_http_version 1.1;
            proxy_set_header   Upgrade $http_upgrade;
            proxy_set_header   Connection keep-alive;
            proxy_set_header   Host $host;
            proxy_cache_bypass $http_upgrade;
            proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header   X-Forwarded-Proto $scheme;
    }

}
使用
nginx-T
(大写
T
)查看nginx正在读取的整个配置。使用
nginx-T
(大写
T
)查看nginx正在读取的整个配置。