本地用MAMP跑的代码,运行没问题。但是部署到CENTOS 6.8 NGINX服务器上的时候,路由地址都404了!
打开/usr/local/nginx/conf/enable-php.conf,追加
set $fastcgi_script_name2 $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+\.php)(/.+)$") { set $fastcgi_script_name2 $1; set $path_info $2; } fastcgi_param PATH_INFO $path_info; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name2; fastcgi_param SCRIPT_NAME $fastcgi_script_name2;