0

I have created two custom error pages in nginx server 404.html and 500.html

I was able to load 404.html file without any issues. But in the place of 500.html, I am getting the default nginx error page (50x.html). Both the files are in the same folder. Please see my conf file content below

error_page   500 502 503 504 /500.html;
location = /500.html {
    root   /usr/share/nginx/html;
}

error_page   404 /404.html;
location = /404.html {
    root   /usr/share/nginx/html;
}

Thanks in advance :)

Captain Buck
  • 679
  • 1
  • 5
  • 17

1 Answers1

1

This works for me.

error_page   500 502 503 504 /500.html;
location = /500.html {
    root   /usr/share/nginx/html;
    internal;
}
 
error_page   404 /404.html;
location = /404.html {
    root   /usr/share/nginx/html;
    internal;
}```

 
    
FishyMine
  • 23
  • 1
  • 9