项目往往需要被支持pathinfo方式访问,给出nginx下相关配置
,找到配置文件nginx.conf,在server { }中添加一段以下代码,重启nginx即可
location ~ \.php { root html/code; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }
重启nginx