NginxとWordPressで画像をアップロードしようとすると「返答が正しいJSONレスポンスではありません。」と出てしまいます。
https://ja.wordpress.org/support/article/nginx/
上記のページの方法を試しているのですが問題が解消しません。
ネット上の似たようなトラブルに遭遇された方の解決方法も試してみましたが
問題の解消には至りませんでした。
私の知識では歯が立たずご教授お願いしたく思います。
また、php-fpmのエラーログのパスを教えていただけますとありがたいです。
nginxのエラーログのパスも教えていただけますとありがたいです。
wordpressの各ファイルの所有者はrootです。
Rockey Linux 9.1です。
どうかよろしくお願いいたします。
/etc/nginx/nginx.confの内容
For more information on configuration, see:
* Official English Documentation: http://nginx.org/en/docs/
* Official Russian Documentation: http://nginx.org/ru/docs/
user root;
worker_processes auto;
worker_cpu_affinity auto;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
include mime.types;
access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; #tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 4096; include /etc/nginx/mime.types; default_type application/octet-stream; # Load modular configuration files from the /etc/nginx/conf.d directory. # See http://nginx.org/en/docs/ngx_core_module.html#include # for more information. include /etc/nginx/conf.d/*.conf; client_max_body_size 13m; index index.php index.html index.htm; include sites-enabled/*; server { listen 443 ssl; server_name xxx.com; #return 302 $scheme://xxx.com$request_uri; root /usr/share/nginx/html; index index.php; ssl_certificate /etc/letsencrypt/live/xxx.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/xxx.com/privkey.pem; # Load configuration files for the default server block. include /etc/nginx/default.d/*.conf; error_page 404 /404.html; location = /404.html { } error_page 500 502 503 504 /50x.html; location = /50x.html { } location ~ \.php$ { root /usr/share/nginx/html; fastcgi_pass unix:/run/php-fpm/www.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME
$document_root/$fastcgi_script_name;
include fastcgi_params; } location /wp-json { try_files $uri $uri/ /index.php?q=$uri$args; } location / { try_files $uri $uri/ /index.php$args; } } include /etc/nginx/global/wordpress.conf;
/etc/nginx/global/wordpress.confの内容
upstream php {
server unix:/tmp/php-cgi.socket;
server 127.0.0.1:9000;
}
server{
server_name junsh.biz;
root /use/share/nginx/html;
location = /favicon.ico { log_not_found off; access_log off; } location = /robots.txt { log_not_found off; access_log off; } location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { include fastcgi.conf; fastcgi_intercept_errors on; fastcgi_pass php; } location ~* \.(js|css|png|jpg|jpeg|gif|ico|webp|webm|ogg|oga)$ { log_not_found off; }
}
Settings for a TLS enabled server.
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name _;
root /usr/share/nginx/html;
ssl_certificate "/etc/pki/nginx/server.crt";
ssl_certificate_key "/etc/pki/nginx/private/server.key";
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 10m;
ssl_ciphers PROFILE=SYSTEM;
ssl_prefer_server_ciphers on;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
}

あなたの回答
tips
プレビュー