Some sites gives Nginx 404 error

HageHosting

Verified User
Joined
Sep 25, 2006
Messages
73
Scherm­afbeelding 2024-05-24 om 12.02.34.png



Scherm­afbeelding 2024-05-24 om 12.04.02.png


Other sites working logfile domain gives this:
Errorlog
2024/05/24 12:01:15 [error] 99018#0: *141212 open() "/home/id238/domains/yesimhairdesign.nl/private_html/nginx_static_files/index.html" failed (2: No such file or directory), client: 82.XXX.XXX.XXX, server: yesimXXXXXXX.nl, request: "GET / HTTP/1.1", upstream: "https://23.88.xxx.xxx:8081/", host: "yesimhairdesign.nl"
Acceslog
82.176.XXX.XXX - - [24/May/2024:12:01:15 +0200] "GET / HTTP/1.1" 404 142 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36"
 
Other sites working logfile domain gives this:
Can you check if the symlink to the public_html still exists?
ls -la /home/id238/domains/yesimhairdesign.nl/

it should contain:
lrwxrwxrwx 1 id238 id238 13 Dec 8 00:59 private_html -> ./public_html

Date and time will differ, this is just an example as how it should look.
 
Can you check if the symlink to the public_html still exists?
ls -la /home/id238/domains/yesimhairdesign.nl/

it should contain:
lrwxrwxrwx 1 id238 id238 13 Dec 8 00:59 private_html -> ./public_html

Date and time will differ, this is just an example as how it should look.
Scherm­afbeelding 2024-05-24 om 23.12.04.png

Is you can see there is a symlink in de the dir, this happend after een backup en restore from one server to a another server both DirectAdmin pro.
with nginx_apache.

when you go to https://yesimhairdesign.nl/index.html you see the website. Without index.html there will be a error.

Some sites workings other sites get this error on the server.
 
Is you can see there is a symlink in de the dir,
Yes as @zEitEr already mentioned it was also with http, meaning this would not be the cause.

Did you changed a document root as he asked?

Without index.html there will be a error.
Hmmz... that's interesting. I don't work with nGinx so I don't know if that is any different with apache. But seems it is not automatically loading (or even seeing) the index.html file, it also works with http when it's added in the url.

I don't know how this is with nGinx. But I did see you have both index.htm and index.html present, both working.
Does it make any difference if you remove the index.html for example by backing it up in a different place to test? As this is giving the error.

I'm wondering if the site will work then, or if in that case the error will be shown for the index.htm file which is still present in that case.

Be aware, this is just a thought, I never worked with nGinx so I could be totally on the wrong track with my thought.
But it's still a good test to see if the the error goes to index.htm then instead, maybe that would shed some light on the cause of the issue.
 
@HageHosting it's not default, something with templates maybe because this:
/home/id238/domains/yesimhairdesign.nl/private_html/nginx_static_files/index.html not default path
 
@HageHosting it's not default, something with templates maybe because this:
/home/id238/domains/yesimhairdesign.nl/private_html/nginx_static_files/index.html not default path
Scherm­afbeelding 2024-05-25 om 07.49.17.png



User nginx.conf config file in the user dir




This is standing in nginx_server_secure.conf:

|CUSTOM2|
# access_log off;
proxy_buffering |PROXY_BUFFERING|;
proxy_pass https://|PROXY_IP|:|PORT_8081|;
proxy_set_header X-Client-IP $remote_addr;
proxy_set_header X-Accel-Internal /nginx_static_files;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_hide_header Upgrade;
}
location /nginx_static_files/
{
# access_log /var/log/nginx/access_log_proxy;
alias "|DOCROOT|/";
internal;
}
|*else|
|NGINX_REDIRECTS|
|HOTLINK_PROTECTION|
|*endif|
 
what shows: nginx -t
because somehow it tries to find files on wrong path, it didn't replace nginx_static_files with correct path.
It was installed as nginx_apache or was converted from clean nginx/apache?
 
When using NGINX+Apache, and if to change DOCUMENT ROOT only in Apache (httpd custom section at admin level), then NGINX will give 404 ERROR for static files.

Whatever the reason was, it seems to be fixed by now.
 
Back
Top