Nginx server配置

/etc/nginx/sites-enabled/default

 

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

        server_name localhost;

        root /home/liu/jnoj/web;  #项目路径
        index index.html index.php;

        location / {
                try_files $uri $uri/ /index.php?$query_string;
                if (!-e $request_filename){
                        rewrite ^/(.*) /index.php last;
                }
        }

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

}

 

posted @ 2018-10-08 18:31  空空空空白  阅读(492)  评论(0编辑  收藏  举报