Nginx中運行PHP框架Laravel的配置文件分享
更新時間:2015年06月26日 11:37:44 投稿:junjie
這篇文章主要介紹了Nginx中運行PHP框架Laravel的配置文件分享,本文直接給出配置示例,需要的朋友可以參考下
配置文件改成這樣
server { listen 80; server_name sub.domain.com; set $root_path '/srv/www/default'; root $root_path; index index.php index.html index.htm; try_files $uri $uri/ @rewrite; location @rewrite { rewrite ^/(.*)$ /index.php?_url=/$1; } location ~ \.php { fastcgi_pass 127.0.0.1:9000; fastcgi_index /index.php; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } location ~* ^/(css|img|js|flv|swf|download)/(.+)$ { root $root_path; } location ~ /\.ht { deny all; } }
在CentOS7.1+Nginx1.8.0+Laravel5.0測試通過
相關(guān)文章
ubuntu上配置Nginx+PHP5 FastCGI服務器配置
ubuntu上配置Nginx+PHP5 FastCGI服務器配置方法, 需要的朋友可以參考下。2010-06-06使用nginx同域名下部署多個vue項目并使用反向代理的方法
這篇文章主要介紹了使用nginx同域名下部署多個vue項目并使用反向代理的方法,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2019-02-02Nginx + Tomcat實現(xiàn)請求動態(tài)數(shù)據(jù)和請求靜態(tài)資源的分離詳解
這篇文章主要給大家介紹了關(guān)于Nginx + Tomcat實現(xiàn)請求動態(tài)數(shù)據(jù)和請求靜態(tài)資源的分離的相關(guān)資料,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2018-07-07