我在https://saskia.photo上在我自己的服务器上安装了带有Nginx和PHP-FPM的wordpress
安装工作很好,但XML-RPC(由Jetpack和手机应用程序使用)会引发以下错误:
您可以通过运行自己查看错误
curl -A "Jetpack by wordpress.com" -is -H 'Content-Type: text/xml' --data 'PHP' && echo
我已经完成了Jetpack’s troubleshooting page但没有运气.
返回的XML错误导致我推测客户端请求XML在Nginx和PHP之间的某处被破坏,因此无法解析它.
server {
listen 80;
listen [::]:80;
server_name saskia.photo;
rewrite ^ https://$server_name$request_uri? permanent;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name saskia.photo;
ssl_certificate /etc/letsencrypt/live/saskia.photo/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/saskia.photo/privkey.pem;
root /srv/wordpress/;
charset utf-8;
client_max_body_size 64M;
# Deny access to any files with a .PHP extension in the uploads directory
location ~* /(?:uploads|files)/.*\.PHP${
deny all;
}
location / {
index index.PHP index.html index.htm;
try_files $uri $uri/ /index.PHP?$args;
}
location ~* \.(gif|jpg|jpeg|png|css|js)${
expires max;
}
location ~ \.PHP${
try_files $uri =404;
fastcgi_split_path_info ^(.+\.PHP)(/.+)$;
fastcgi_index index.PHP;
fastcgi_pass unix:/var/run/PHP/wordpress.sock;
fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
include fastcgi_params;
}
}
有没有人看到这样的问题或者我的配置文件中发现了问题?
最佳答案
原文链接:https://www.f2er.com/nginx/435246.html