Last Updated on February 5, 2024
Wrong
location = /robots.txt { allow all; log_not_found off; access_log off; }
Correct
location = /robots.txt { try_files $uri $uri/ /index.php?$args; access_log off; log_not_found off; }
References
https://medium.com/@oktay.acikalin/wordpress-nginx-virtual-robots-txt-and-404-bd5cc082725d