CodeIgniter nginx Rewrite rule configuration "Go"

Source: Internet
Author: User
Tags codeigniter

Transferred from: http://www.nginx.cn/1134.html

How can Nginx be configured to support CodeIgniter?

1. CodeIgniter URL beautification to remove index.php

12345 Location / { root html/gxtp;              index  index. Php try_files $uri $uri/ /index. PHP? $uri& $args;         }

2. The URL rewrite, as codeigniter as thinkphp, is also implemented using PATHINFO, which requires fastcgi_split_path_info to set $_server[' PATHINFO '.

12345678910 Location ~ ^. +. php { include fastcgi_params; root html/gxtp; fastcgi_pass 127.0.0.1:9000; fastcgi_index index. PHP;            Fastcgi_split_path_info ^ ( (? U . +php) (/+) $ fastcgi_param SCRIPT_filename $document_root$fastcgi_script_name; fastcgi_param PATH_info $fastcgi_path_info; fastcgi_param PATH_translated $document_root$fastcgi_path_info;         }

CodeIgniter full version nginx.conf rules

1234567891011121314151617181920212223242526272829303132333435 worker_processes 1; Events { worker_connections 1024x768; }http { include mime. Types; default_type application/octet-stream; sendfile on; keepalive_timeout ; Server { Listen ; server_name www. 264.cn; Location / { root html/KDW; Index index. PHP; try_files $uri $uri/ /index. PHP? $uri& $args;         } Location ~ ^. +. php { include fastcgi_params; root html/KDW; fastcgi_pass 127.0.0.1:9000; fastcgi_index index. PHP;            Fastcgi_split_path_info ^ ( (? U . +php) (/+) $ fastcgi_param SCRIPT_filename $document_root$fastcgi_script_name; fastcgi_param PATH_info $fastcgi_path_info; fastcgi_param PATH_translated $document_root$fastcgi_path_info;         }    }}

CodeIgniter nginx Rewrite rule configuration "Go"

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.