Codeinigiter + Nginx 配置
Codeinigiter 项目移植到 Nginx 服务器上,蛮蛋疼的,搞了一下午,记录一下关键部分配置,这里去除 index.php
[shell] location /{ index index.html index.php; if (-e $request_filename) { break; } if (!-e $request_filename) { rewrite ^/(.*)$ /index.php/$1 last; break; } }
location ~ .+.php($|/){ root /home/wwwroot/crm; fastcgi_index index.php; fastcgi_split_path_info ^(.+.php)(.*)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_pass unix:/tmp/php-cgi.sock; include fastcgi_params; } [/shell]
fastcgi_pass 指定的 FastCgi 端口或者套接字不能错了,要不然一直 502 错误,就是这个搞了我半天。
转载请注明: 转载自Ryan 是菜鸟 | LNMP 技术栈笔记
如果觉得本篇文章对您十分有益,何不 打赏一下
本作品采用知识共享署名-非商业性使用 4.0 国际许可协议进行许可