+1 vote
1) When requesting derivatives it is for example localhost/folder or localhost/folder It returns the correct 404.php page from wordpress. But when I try to write like this localhost/folder.txt or folder.html, it displays a 404 page from nginx. I know that something needs to be prescribed in the nginx config, but I do not know what.
2) How to configure dynamic robots.txt in Wordpress, again because txt files are processed by nginx is not possible to make a virtual robots.txt, something in the config should be prescribed. I would like to prescribe a config that in general would give all the file extensions to process php if php starts working with one of these extensions.
dodo512 Thank you, not exactly what you need.
There's probably something likelocation ~ \.(jpg|png|html|txt|...)
Just delete the txt from the template and the folder.txt queries will go into Wordpress.

1 Answer

0 votes
Found a way to
location ~* ^.+\.(.+)$ {
try_files $uri $uri/ /index.php?$args;
log_not_found off;
Any line from the beginning - ^.+ Dot symbol - \. Any extension - (.+)
We give it to php for processing - try_files $uri $uri index.php?$args;
You can also set up a 404 page in php.