Nginx path_info Configuration

Source: Internet
Author: User
My configuration is now like this

location ~ \.php$ {            fastcgi_split_path_info ^(.+\.php)(/.+)$;            # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini            # With php5-cgi alone:    #       fastcgi_pass 127.0.0.1:9000;            # With php5-fpm:            fastcgi_pass unix:/var/run/php5-fpm.sock;            fastcgi_index index.php;            include fastcgi_params;    }

How to configure the $_server[' Path_info ' come out??

Reply content:

My configuration is now like this

location ~ \.php$ {            fastcgi_split_path_info ^(.+\.php)(/.+)$;            # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini            # With php5-cgi alone:    #       fastcgi_pass 127.0.0.1:9000;            # With php5-fpm:            fastcgi_pass unix:/var/run/php5-fpm.sock;            fastcgi_index index.php;            include fastcgi_params;    }

How to configure the $_server[' Path_info ' come out??

Location ~ \.php$ {
Fastcgi_split_path_info ^ (? U). +.php) (/?. +)$;
Fastcgi_param Script_filename/path/to/php$fastcgi_script_name;
Fastcgi_param path_info $fastcgi _path_info;
Fastcgi_param path_translated $document _root$fastcgi_path_info;
}

location ~ \.php {    fastcgi_pass 127.0.0.1:9000;    fastcgi_index index.php;    include fastcgi_params;    set $real_script_name $fastcgi_script_name;    if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {            set $real_script_name $1;            set $path_info $2;    }    fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;    fastcgi_param SCRIPT_NAME $real_script_name;    fastcgi_param PATH_INFO $path_info;}location / {    if (!-e $request_filename)    {        rewrite  ^/xxxx/(.*)$  /xxx/index.php/$1  last;    }}

Take a look at this.
Nginx Configuration PathInfo

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