Nginx+ci 404 error, nginxci404 error
Recently just learned CI framework, did a simple project, in the local server environment has been tuned, but when deployed to the remote server:
http://example.com/(index.php)/accessible (default controller-class for configuration)
http://example.com/(index.php)/[controller-class]/[controller-method] can not be accessed (prompt for 404 Error!) )
Finally Baidu Reason:
for/INDEX.PHP/ABC This url,apache and lighttpd will be interpreted as "index.php?abc", and Nginx will assume that the request name is "index.php". the contents of the ABC file under the directory. So CI under nginx does not configure rewrite is not operational, and in Apache and Lighttpd is normal. Solution (Essentials Plus
Coarse, Key markers Red):
1 server {2Listen 80;3server_nameexample.com;4Root/data/wwwroot/example/5Index index.php index.html Index.htm;6 7Location ~* \. (Css|js|swf|htm|jpg|png|gif|json|atlas)?$ {8 expires 1d;9Add_header Pragma Public;TenAdd_header Cache-control "Public"; One } A -Location/Controller-class/ { - if(!-E$request _filename) { theRewrite ^/Controller-class/(.*)$ /Controller-class/index.php?q=$uri&$args; - } - } - +Location ~ \.php$ { -Fastcgi_pass 127.0.0.1:9000; +Fastcgi_index index.php; AFastcgi_param Script_filename$document _root$fastcgi_script_name; atFastcgi_param Php_value open_basedir=$document _root:/tmp/:/proc/; - includeFastcgi_params; - } - -}
Reference: http://www.2cto.com/os/201301/185926.html "Nginx+ci 404 Error Problem"
http://www.bkjia.com/PHPjc/1105554.html www.bkjia.com true http://www.bkjia.com/PHPjc/1105554.html techarticle nginx+ci 404 error, nginxci404 error recently learned CI Framework, did a simple project, in the local server environment has been tuned, but deployed to the remote server: http: ...