我有一个在NGINX上运行的股票CI应用程序。没有重写(我尝试了16个小时,并没有得到它的工作,它是500,404,403或输入文件没有指定),PHP文件被传递给php-fpm。CodeIgniter,NGINX里面的文件夹不工作
这里提供的网站在我的默认文件(Ubuntu的12.04,尝试一切在CentOS并没有什么工作):
server {
listen 80;
root /usr/share/nginx/www/;
index index.php index.html index.htm;
server_name fish-in-a-bowl.net;
location/{
try_files $uri $uri/ /index.html;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/www/cloud;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
#fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
而且config.php
:
$config['base_url'] = 'http://fish-in-a-bowl.net/zz/';
$config['index_page'] = 'index.php';
//$config['index_page'] = '';
//$config['uri_protocol'] = 'PATH_INFO';
//$config['uri_protocol'] = 'QUERY_STRING';
//$config['uri_protocol'] = 'REQUEST_URI';
//$config['uri_protocol'] = 'DOCUMENT_URI';
//$config['uri_protocol'] = 'ORIG_PATH_INFO';
$config['uri_protocol'] = 'AUTO';
我已经尝试了所有可用的选项,但没有工作。这个节点在Digital Ocean上,他们有用Apache设置CI而不是NGINX的教程。
默认控制器的工作原理,但是当通过http://fish-in-a-bowl.net/zz/index.php/welcome访问我得到No input file specified.
帮助?这太奇怪了。
SCREENSHOT>
尝试:fastcgi_param SCRIPT_FILENAME /路径/到/ WWW/$ fastcgi_script_name; –
我试过了,同样的错误没有指定输入文件。在Ubuntu 12.04上它是/ usr/share/nginx/www/ –
从技术上讲,它是你想要的任何东西,你是否在我的答案中尝试过配置? –