nginx is now 404 Not Found
I had nginx before, but now it's 404 on web. Maybe something restarting, but I don't know for sure.
404 Not Found
nginx/1.18.0 (Ubuntu)I have searched for various errors nginx. sudo nginx -t is ok.
/var/log/nginx/error.log
[notice] 60852#60852: signal process startedcurl -I
HTTP1.1 404 Not Found
Server: nginx/1.18.0 (Ununtu)
Date: Thu, 27 Aug 21:02:56 GMT
Content-Type: text/html
Content-Length: 162
Connection: keep-alive/etc/nginx/sites-available/test.conf
server {
listen 80;
listen [::]:80;
root /var/www/html/
index index.php index.html index.htm;
server_name test.com
location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}
include /var/www/html/
# new lines
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/ # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/ # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}/etc/nginx/nginx.conf
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events { worker_connections 768;
}
http { sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE ssl_prefer_server_ciphers on; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; gzip on; include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*;
}sudo service nginx reload, ok
Can you help me?
42 Answers
"404 Not Found" means that the system can't find a particular resource on a web server. So the issue is with the server. So, try again tomorrow.
Some Ngnix-based virtual servers need exact IP addresses. It's to easy check by this:
curl <-- return 404 error
curl -vk <-- OKThis is caused by nginx configurations.
Add your server's IP address on your virtual server block:
server {
listen 80;
listen [::]:80;
root /var/www/html/
index index.php index.html index.htm;
server_name test.com
listen 10x.32.22.xx; # adds your server ip That's a key point of my nginx server configurations.