How to fix 404 not found nginx problem?

I run Nginx on my wordpress site, but now all pages and categories, except homepage, suddenly appear “404 not found, Nginx”, the permalinks are correct and i don’t do anything before such problem occur. How can i troubleshoot and fix this problem?

Thank you!

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Change the line in the location block to:

try_files $uri $uri/ /index.php?q=$uri&$args;

and reload nginx

sudo systemctl reload nginx

All should be well :)

I change my admin url to the ip and when I try using the link https://14.*******.-world-admin

It gives me white page with page not found, how do I fix this?

Do you run a php-fpm interpreter or do you proxy-pass to a apache with php module running on your server? In first case please have all corresponding rewrite rules in your nginx config checked and static files locations to be set up to a right path. In the second case please check .htaccess file in your website root to be accessible by a webserver and to contain apropriate WP rewrite rules.