Help to custom error 404

hibrid0

New member
Joined
Aug 30, 2025
Messages
2
Points
1
Age
40
Hi, I'm really new with this panel and I dont know how can I change the error 404.

Recently migrate from another server and checking I get a lot of 404, the I want to custom this error to something more nice and like the other pages inside our domain.

I try with /etc/nginx/sites-enabled/mydomain.conf and there the suggestion by chatgpt and reload nginx and not working.
 
Hi, I'm really new with this panel and I dont know how can I change the error 404.

Recently migrate from another server and checking I get a lot of 404, the I want to custom this error to something more nice and like the other pages inside our domain.

I try with /etc/nginx/sites-enabled/mydomain.conf and there the suggestion by chatgpt and reload nginx and not working.
Don’t edit /etc/nginx/sites-enabled/ because CloudPanel overwrites it. Instead, create /home/cloudpanel/htdocs/mydomain.com/nginx/custom.conf with your error_page settings, put custom-404.html in the public folder, and run systemctl reload nginx.


or

Or, alternatively, edit the vhost file in the control panel more clearly. Do not touch the site_enabled section.
 
Don’t edit /etc/nginx/sites-enabled/ because CloudPanel overwrites it. Instead, create /home/cloudpanel/htdocs/mydomain.com/nginx/custom.conf with your error_page settings, put custom-404.html in the public folder, and run systemctl reload nginx.


or

Or, alternatively, edit the vhost file in the control panel more clearly. Do not touch the site_enabled section.
I check the location you said, but not found.
I found this:
root@myserver:/home/clp/services/nginx# ls
basic-auth fastcgi_params koi-win modules-enabled proxy_params sites-enabled ssl-certificates win-utf
fastcgi.conf koi-utf mime.types nginx.conf scgi_params ssl uwsgi_params

but in
root@myserver: /home/clp# ls
backups htdocs logs scripts services

and under htdocs just 1 folder called app.

can you tell me small example to set the 404 error from vhost config on control panel?
 
I don't think you understood me.

Place the following code inside the vhost file and enter the address of your 404 page. That's all there is to it.

Code:
error_page 404 /404.html;
location = /404.html {
    root /var/www/html;
    internal;
}
 
Back
Top