小知识: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测试通过

声明: 猿站网有关资源均来自网络搜集与网友提供,任何涉及商业盈利目的的均不得使用,否则产生的一切后果将由您自己承担! 本平台资源仅供个人学习交流、测试使用 所有内容请在下载后24小时内删除,制止非法恶意传播,不对任何下载或转载者造成的危害负任何法律责任!也请大家支持、购置正版! 。本站一律禁止以任何方式发布或转载任何违法的相关信息访客发现请向站长举报,会员发帖仅代表会员个人观点,并不代表本站赞同其观点和对其真实性负责。本网站的资源部分来源于网络,如有侵权烦请发送邮件至:2697268773@qq.com进行处理。
建站知识

小知识:Linux 5.10-rc5 测试版发布:仍有许多 Bug 待修复,预计年底前推出正式版

2023-5-5 4:25:29

建站知识

小知识:Linux的压缩和解压缩的方法总结

2023-5-5 4:34:01

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索