2016-08-19 50 views
0

我已經部署了CentOS的服務器上我laravel應用程序,我不得不下面提到線在httpd.conf中添加,使其工作感動Laravel項目從Apache到Nginx的

<Directory "/var/www/html/ezschedular2/public"> 
    Allowoverride All 
</Directory> 

我們決定現在使用nginx ,這些線的替代是什麼?我必須在default.conf文件夾中添加其他的這些行/etc/nginx/conf.d

回答

0

這是我爲Laravel配置的nginx。更改變量適合您的需要

server { 
    listen 80; 
    server_name YOURSERVERNAME_OR_IP; 
    root YOUR_PATH_TO_LARAVEL_PUBLIC_FOLDER; 

    index index.html index.htm index.php; 

    charset utf-8; 

    location/{ 
     try_files $uri $uri/ /index.php?$query_string; 
    } 

    location ~ \.php$ { 
     fastcgi_split_path_info ^(.+\.php)(/.+)$; 
     fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; 
     fastcgi_index index.php; 
     include fastcgi_params; 
     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
    } 
} 
+0

謝謝,將嘗試它並儘快更新 –