基本は WordPress | NGINX
に書いてある設定をすれば良い。
対象のサブディレクトリのlocationでtry_filesを追加する。
大事なのは、サブディレクトリのtry_filesの書き方で、こうやって書く。
=404 を入れないこと。
location /wordpress {
try_files $uri $uri/ /wordpress /index.php?$args;
}
最後に =404 を入れてしまうと、not foundが出続けます。
この書き方はNGです。
location /wordpress {
try_files $uri $uri/ /wordpress /index.php?$args =404;
}