まず第一に、はい、これらのような質問はたくさんありますが、解決策はどれもうまくいきませんでした. 比較する同様のサーバーがあり、構成を調べたところ、機能しているように見えますが、この新しいセットアップは機能していません。
私はすでに、優勢なしで構成を修正しようとしました。
私のnginx.conf:
[default content]
#I just appended this line:
client_max_body_size 10M;
私の仮想ホストファイル:
server {
listen 80;
listen [::]:80;
# root /var/www/mywebsite.com/public_html;
# index index.html;
server_name mywebsite.com www.mywebsite.com;
# access_log /var/log/nginx/mywebsite.com.access.log;
# error_log /var/log/nginx/mywebsite.com.error.log;
include snippets/letsencrypt.conf;
return 301 https://$host$request_uri;
# location / {
# try_files $uri $uri/ =404;
}
server {
listen 443 ssl http2;
server_name www.mywebsite.com;
ssl_certificate /etc/letsencrypt/live/mywebsite.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mywebsite.com/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/mywebsite.com/chain.pem;
include snippets/ssl.conf;
include snippets/letsencrypt.conf;
return 301 https://mywebsite.com$request_uri;
}
server {
listen 443 ssl http2;
server_name mywebsite.com;
ssl_certificate /etc/letsencrypt/live/mywebsite.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mywebsite.com/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/mywebsite.com/chain.pem;
include snippets/ssl.conf;
include snippets/letsencrypt.conf;
root /var/www/mywebsite.com/public_html;
index index.php;
# . . . other code
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
}
#location / {
# try_files $uri $uri/ /index.php?$args;
#}
#location ~ \.php$ {
# fastcgi_split_path_info ^(/wordpress)(/.*)$;
#}
include snippets/phpmyadmin.conf;
}
PS はい、WordPress を使用しています。