最近apache老崩溃,把我搞烦了,换fpm试试看。
简中互联网搜了一圈,内容一堆重复,但是不起作用,有点难绷。。。
参考:
https://stackoverflow.com/questions/31003448/nginx-wordpress-url-rewriting-with-another-rule
最终配置:
server {
# .....端口域名SSL配置省略
root /usr/share/nginx/php/blog;
index index.php index.html;
location / {
try_files $uri $uri/ $uri.html $uri.php /index.php?$args;
}
location ~ \.php$ {
fastcgi_pass 10.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;
}
}

