Fix nginx configuration to support WordPress Core's Virtual Robots.txt
Currently the nginx config :
location = /robots.txt {
accesslog off;
lognot_found off;
}
Fails to pass robots.txt requests to WordPress which returns a 404 when it would normally server WordPress's default virtual robots.txt. This viritual robots.txt is also used be sevreal plugins that hook into and customize it.
fix:
location = /robots.txt {
tryfiles $uri $uri/ /index.php?$args;
accesslog off;
lognotfound off;
}
For reference please see:
https://developer.wordpress.org/reference/functions/do_robots/
also useful:
https://wordpress.stackexchange.com/questions/248124/generating-robots-txt-dynamically

This update is live. Thanks again for taking the time to request this!
-
Jon Brown commented
Thanks Jessica.