Nginx+ci 404 error, nginxci404 error _php Tutorial

Source: Internet
Author: User

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: ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.