Nginx supports php ci framework

Source: Internet
Author: User

Nginx supports php ci framework

1. Find the configuration file modification for the CI Library

$ Config ['base _ url'] = 'HTTP: // test.example.com ';
$ Config ['uri _ Protocol'] = 'path _ info ';
2. Find NGINX configuration. Add the following code segment to the SERVER segment:


Location/index. php {
Fastcgi_pass unix:/tmp/php-cgi.sock;
Fastcgi_param SCRIPT_FILENAME/home/wwwroot/index. php;
Fastcgi_param PATH_INFO $ fastcgi_path_info;
Fastcgi_split_path_info ^ (. + \. php) (. *) $;
Fastcgi_param PATH_TRANSLATED $ document_root $ fastcgi_path_info;
Fcinclude gi. conf;
}
3. If you want to perform a jump, (for example, http://test.example.com/index.php/test)
Http://test.example.com/test.) You can add the following configuration in the server segment:
Location /{
If (-f $ request_filename ){
Expires max;
Break;
}
If (! -E $ request_filename ){
Rewrite ^/(. *) $/index. php/$1 last;
}
}

Recommended reading:

Configure and optimize reverse proxy and load balancing in Nginx

Nginx load balancing: nginx: [emerg] cocould not build the types_hash

Nginx Load Balancing module ngx_http_upstream_module details

Nginx + Firebug allows the browser to tell you which Server Load balancer distributes requests

Ubuntu install Nginx php5-fpm MySQL (LNMP environment setup)

Nginx details: click here
Nginx: click here

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.