How to fix 404 not found nginx problem?

April 21, 2016 12.4k views
Nginx WordPress

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!

1 comment
  • Hi!

    In order to be able to help you, please post your nginx server block config (usually /etc/nginx/sites-enabled/file.conf) and the last few lines of Nginx's error log:

    sudo tail -n 20 /var/log/nginx/error.log
4 Answers

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.

I did not understand what to do to solve.
Someone explain to me what is causing this problem?
Thank you!

I have exactly the same, everything worked well, and I don't know why, at one moment, all pages turned into 404 error. It works when I disabled permalinks, but I've tried everything..

Did you resolve your problem ? Thanks.

Have another answer? Share your knowledge.