Php Nginx同时使用端口80和8080

Php Nginx同时使用端口80和8080,php,nginx,varnish,Php,Nginx,Varnish,在/etc/nginx/site enabled/default中,我将nginx的侦听端口从80更改为8080,但在netstat-plnt结果中,它同时使用这两个端口: 这是我的nginx默认配置 server { listen 8080 default; root /home/mosi/workspace; # Add index.php to the list if you are using PHP index index.html index.ht

/etc/nginx/site enabled/default
中,我将nginx的侦听端口从80更改为8080,但在
netstat-plnt
结果中,它同时使用这两个端口:

这是我的nginx默认配置

server {
    listen 8080 default;
    root /home/mosi/workspace;

    # Add index.php to the list if you are using PHP
    index index.html index.htm index.php;

    server_name _;

    location / {
            try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
            include snippets/fastcgi-php.conf;
            fastcgi_pass unix:/run/php/php7.2-fpm.sock;
    }
}

问题已解决

因为我有很多其他配置文件,所以我只是在其他配置中添加了端口侦听线路,现在可以正常工作了
Tahnks

同样,在这次更改之后,我重新启动并重新加载nginx服务。你确定你不仅仅在运行另一个实例,或者你没有另一个
服务器
80
上阻止监听吗?我有一些其他站点的配置文件,但这些站点没有监听命令。在你的
nginx.conf
或同等站点中呢在其他my配置中侦听线路并解决问题:|