thinkphp configuring Nginx pseudo-static and resolving pathinfo problems and fix_pathinfo vulnerabilities

Source: Internet
Author: User

nginx.conf server configuration, when the file does not exist, the use of pseudo-static

server{    801;    Index  index.html index.htm index.php;    Root D:/data/code/jsjh-admin/wwwroot;     /{        if (-e $request _filename) {            ^ (. *) $/index.php$1 last ;        }    }    Include dotphp.conf;}

dotphp.conf Configuring PHP's Path_info
Location ~ (\.php$|\.php/{#定义变量 $path _info for storing pathinfo information set $path _info"";    #定义变量 $real _script_name for storing the real address set $real _script_name $fastcgi _script_name; #如果地址与引号内的正则表达式匹配if($fastcgi _script_name ~"^ (. +?\.php) (/.+) $"{#将文件地址赋值给变量 $real _script_name set $real _script_name $1; #将文件地址后的参数赋值给变量 $path _info set $path _info $2;    } Fastcgi_index index.php;    Include Fastcgi_params, #先载入默认的 #然后在下面加就能覆盖默认的配置 fastcgi_param script_filename $document _root$real_script_name;    Fastcgi_param script_name $real _script_name;    Fastcgi_param path_info $path _info; if(-e $document _root$real_script_name) {Fastcgi_pass127.0.0.1:9000; }}

Configuration php.ini Resolve Nginx File type Error parsing vulnerability

[PHP] cgi.fix_pathinfo=0; set 0 To resolve the Nginx file type Error parsing vulnerability

thinkphp configuring Nginx pseudo-static and resolving pathinfo problems and fix_pathinfo vulnerabilities

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.