実現したいこと
Nginxのリバースプロキシ環境課でWordPressを動かしたいのですが、ログイン画面が404エラーになってしまう。
環境はこんな感じ
WAN
↓
Nginx(192.168.200.100)
↓
Nginx wordpress (192.168.200.151)
/var/www/html/wordpress(とりあえずこっちにアクセスしたい)
/var/www/html/wordpress02
/var/www/html/wordpress03
Nginx(192.168.200.100)側のconfig
server { root /var/www/html; # Add index.php to the list if you are using PHP index index.html index.htm index.nginx-debian.html index.html index.php; #listen 80; listen [::]:443 ssl; # managed by Certbot listen 443 ssl; ssl_certificate /etc/letsencrypt/live/<ドメイン名>/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/<ドメイン名>/privkey.pem; # managed by Certbot server_name <ドメイン名>; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; proxy_set_header X-Forwarded-Proto https; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; location / { proxy_pass http://192.168.200.151/wordpress/; } # pass PHP scripts to FastCGI server location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php8.1-fpm.sock; } } map $http_upgrade $connection_upgrade { default upgrade; '' close; }
Nginx wordpress (192.168.200.151)側のconfig
server { listen 80 default_server; listen [::]:80 default_server; server_name _; index index.html index.htm index.nginx-debian.html index.php; client_max_body_size 3G; root /var/www/html/; location / { try_files $uri $uri/ /wordpress/index.php?$args; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php8.1-fpm.sock; } }
wp-config.php 追記分
define('FORCE_SSL_ADMIN', true); if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false){ $_SERVER['HTTPS'] = 'on'; $_SERVER['SERVER_PORT'] = 443; } if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) { $_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_HOST']; }
困っていること
wp-login.phpのみ 404エラーになってしまう
原因としてはどんな事があるでしょうか?

回答1件
あなたの回答
tips
プレビュー
下記のような回答は推奨されていません。
このような回答には修正を依頼しましょう。
また依頼した内容が修正された場合は、修正依頼を取り消すようにしましょう。