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!
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.
I still having this problem @kamaln7 help! my server block config etc/nginx/sites-enabled/kinbuweb is:
server {
listen 80;
listen [::]:80;
root /var/www/kinbuweb/public;
index index.php index.html index.htm index.nginx-debian.html;
server_name kinbu.localhost;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
And my sudo tail -n 20 /var/log/nginx/error.log
from when I started having the problem:
2017/01/30 16:42:58 [notice] 2385#2385: signal process started
2017/01/30 16:46:45 [notice] 2468#2468: signal process started
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.
I did not understand what to do to solve. Someone explain to me what is causing this problem? Thank you!
This comment has been deleted
go to /etc/nginx/sites-available folder open relavent file of your website replace the line with try_files $uri $uri/ /index.php?q=$uri&$args; and restart the server
im also getting an 404 nginx not found error MYCONFIG FILE IS:
vi reverse_proxy.conf
server {
listen 80;
location / {
proxy_pass http://myip;
}
}
ERROR LOG IS:
sudo tail -n 20 /var/log/nginx/error.log
2019/05/04 13:21:36 [emerg] 4934#4934: no host in upstream "" in /etc/nginx/sites-enabled/reverse-proxy.conf:4
2019/05/05 10:08:30 [error] 4990#4990: *51 connect() failed (111: Connection refused) while connecting to upstream, client: 216.144.240.130, server: , request: "HEAD /robots.txt HTTP/1.0", upstream: "http://myip:80/robots.txt"
What may be the reason for this?
Click below to sign up and get $100 of credit to try our products over 60 days!
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:i have same problem 2017/06/07 06:18:44 [error] 21807#21807: *4 open() “/srv/roi/app/webroot/50x.html” failed (2: No such file or directory), client: 91.230.47.3, server: www.138.197.105.108, request: “GET / HTTP/1.0”, upstream: “fastcgi://unix:/var/run/php5-fpm.sock”