nginx配置一个Ip多端口多站

在/usr/local/nginx/conf/vhost目录下新建一个.conf文件,内容

server
    {
        listen 端口1;
        #listen [::]:80;
        server_name IP地址;
        index index.html index.htm index.php default.html default.htm default.php;
        root  /home/wwwroot/网站项目文件夹;

        include none.conf;
        #error_page   404   /404.html;
        include enable-php.conf;

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }

        location ~ .*\.(js|css)?$
        {
            expires      12h;
        }

        location ~ /\.
        {
            deny all;
        }

        access_log off;
    }
--------------------- 
作者:童大大 
来源:CSDN 
原文:https://blog.csdn.net/tongdengquan/article/details/64920139?utm_source=copy 
版权声明:本文为博主原创文章,转载请附上博文链接!

猜你喜欢

转载自blog.csdn.net/m0_37971044/article/details/83060787