Report this

What is the reason for this report?

Custom 404 not working in my nginx droplet, please help?

Posted on October 25, 2019
C K

By C K

I’m am new in nginx and before I user apache web server. So I got to know that .htaccess does not works in nginx, after doing some research I got to know about nginx.conf. When I added the 404 code in http inside server tree and reloaded nothing happens and the default 404 page is returned.

error_page 404 /404.html;
location  /404.html {
  internal;
}

I even tried doing this in my /etc/nginx/sites-available/default conf, but still no luck, however Im confused where should I put the code, in sites default conf or in the global nginx conf. Can some one please give me brief on this topic! Appreciate your help

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.