亲宝软件园·资讯

展开

lnmp部署laravel

史亚运 人气:0

修改nginx/conf/nginx.conf里 server下root项目入口文件目录

server
    {
        listen 80 default_server reuseport;
        #listen [::]:80 default_server ipv6only=on;
        server_name _;
        index index.html index.htm index.php;
        #root  /home/wwwroothttps://img.qb5200.com/download-x/default;
        root  /home/wwwroot/www.shiyayun.cn/public;

nginx/conf/nginx.conf里server下新增 location /

        location / {
            index index.html index.htm index.php;
            try_files $uri $uri/ /index.php?$query_string; #隐藏index.php
        }

注释nginx/conf/enable-php.conf 里的try_files $uri =404;

location ~ [^/]\.php(/|$)
        {
            #try_files $uri =404;
            fastcgi_pass  unix:/tmp/php-cgi.sock;
            fastcgi_index index.php;

            include fastcgi.conf;
        }

lnmp restart重启环境

加载全部内容

相关教程
猜你喜欢
用户评论