nginx.conf
server {
listen 80;
server_name loaclhost;
location / {
root /home/wwwroot/default;
index index.htm index.html index.php;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
location ~ .+\.php($|/) {
root /home/wwwroot/default/locus_map/public;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
出现502错误可能是php-fpm没有监听9000,修改php-fpm.conf的listen=127.0.0.1:9000即可