一台linux服务器中的ngix 2服务器块

一台linux服务器中的ngix 2服务器块,linux,nginx,Linux,Nginx,我无法重新启动nginx,因为我将[emerg]6594 6594:bind()设置为0.0.0.0:443失败(98:地址已在使用)。多服务器块是如何工作的?没有临时服务器块,我的配置工作正常 server { listen 80 default_server; listen [::]:80 default_server; server_name api.example.com; location / { proxy_pass http://

我无法重新启动nginx,因为我将
[emerg]6594 6594:bind()设置为0.0.0.0:443失败(98:地址已在使用)
。多服务器块是如何工作的?没有临时服务器块,我的配置工作正常

server {
    listen 80 default_server;
    listen [::]:80 default_server;

    server_name api.example.com;

    location / {
        proxy_pass http://localhost:3001;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

server {
    listen 443;

    server_name staging-api.example.com;

    location / {
        proxy_pass http://localhost:3002;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

netstat-anp | grep:443
检查哪个应用程序接管了443端口,如果没有必要,杀死它,然后重新启动nginx

错误表明该地址已在使用。这意味着有一个进程已经在使用该端口443。找到正在使用该端口的进程,杀死它,然后再次尝试启动nginx@MukeshVerma端口443到底是什么?443端口的可能副本是一个用于https连接的保留端口,就像正常http连接使用80一样!!