Nginx + CI 404 error

Source: Internet
Author: User
Nginx + CI error 404. for URLs such as/index. php/abc, Apache and Lighttpd will Press index. php? Nginx considers the request name to be the content of the abc file in the index. php directory. Therefore, CI cannot run without configuring rewrite in nginx... nginx + CI error 404 for/index. for URLs such as php and abc, Apache and Lighttpd press "index. php? Nginx considers the content of the abc file under the "index. php" directory as the request name. Therefore, CI cannot run without configuring rewrite in nginx, but is normal in Apache and Lighttpd. In Nginx www.2cto.com, rewrite ^/(. *) $/index. php? $1 last; for rewrite requests, for:/abc. such requests as abc will be rewritten into "index. php/abc_abc, that is, the "point" is changed to "underline", it is not clear why. The rewrite rule in the Nginx configuration file is not executed only once, but is "executed once. if break is not met, it will be executed again in the new path after rewrite, it will not work until it no longer changes or encounters a break or returns a 500 error exit after it is executed for 10 times. Therefore, the rewrite rules in knowledge 2 of www.2cto.com alone cannot be used. you need to add a break to the end, in this way, it will not be executed after the rewrite. Location/firefoxbug/{index. php; if (! -E $ request_filename) {rewrite ^/(. *) $/firefoxbug/index. php? $1 last; break ;}}
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.