By dronerscomng
I followed the tutorial on ‘https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-to-use-custom-error-pages-on-ubuntu-14-04’ to add a custom 404 page to my ip but instead of showing 404 page it shows internal sever error my error log is :
2019/10/31 13:42:18 [emerg] 12796#12796: duplicate location “/testing” in /etc/nginx/sites-enabled/default:94 2019/10/31 13:42:43 [emerg] 12828#12828: duplicate location “/testing” in /etc/nginx/sites-enabled/default:94 2019/10/31 13:46:06 [emerg] 12871#12871: unknown directive “First” in /etc/nginx/sites-enabled/default:51 2019/10/31 13:48:22 [emerg] 12905#12905: unknown directive “First” in /etc/nginx/sites-enabled/default:51 2019/10/31 13:51:43 [emerg] 12941#12941: unknown directive “First” in /etc/nginx/sites-enabled/default:51 2019/10/31 13:54:48 [emerg] 12979#12979: unknown directive “First” in /etc/nginx/sites-enabled/default:51 2019/10/31 14:02:05 [emerg] 13058#13058: duplicate location “/testing” in /etc/nginx/sites-enabled/default:95 2019/10/31 14:02:23 [emerg] 13090#13090: duplicate location “/testing” in /etc/nginx/sites-enabled/default:95 2019/10/31 15:24:34 [emerg] 13848#13848: duplicate location “/custom_404.html” in /etc/nginx/sites-enabled/default:80
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi @dronerscomng,
It seems you have an error in your /etc/nginx/sites-enabled/default file on line 51. The error states, there is an Unknown directive “First”. This is why you are getting a 500 Internal Server Error as opposed to a 404 Not Found error/page.
I can give you a hint where to look if you provide us with the default file around the line 51.
Regards, KDSys
Two things!
First, you have there two different classes of error. You’ve tried to set up a custom 404 page, which will be used for 404 responses. But the internal server error response is 500, and to overwrite this page you would need to create a custom 500 page.
Here is a brief description of HTTP errors:
404 is not found)500 is internal server error)The other thing is the error itself, from the log messages it seems there’s something wrong with your Nginx configuration file. Try nginx -t to see what errors it might show, re-check your file and read the surrounding instructions in the tutorial.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.