Nginx同时使用端口80和8080

时间:2018-08-20 02:12:28

标签: php nginx varnish

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

enter image description here

这是我的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;
    }

}

问题已解决

由于我还有许多其他配置文件,所以我只是在其他配置中添加了端口侦听线,并且现在可以正常工作 火车

0 个答案:

没有答案
相关问题