Report this

What is the reason for this report?

I am using Ubuntu and Nginx findign that 404 errors are going to 500 errors

Posted on May 23, 2018

Here is my server block code

rewrite ^/home$ https://style-.com permanent;
        rewrite ^/index$ https://style.com permanent;

        location ~* \.(?:css|js|gif|jpeg|jpg|png)$ {
                expires max;
                add_header Cache-Control public;
        }

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

This is working for a different website and I have looked everywhere online. If anyone has any ideas I would like to know.

I tried to look at the error logs in /var/log/nginx/error.log but there is nothing for the issue just some errors for other website.

I included rewrite rules at the top as this is a joomal website and those /home and /index url’s point to the same place so thats why I am redirecting them. I show them as this is custom code which I am not sure is giving an issue.

How can I be sure that it isn’t my actual site that is actually getting a 500 error and is unable to show the 404 page?

Thanks.



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!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
0

Accepted Answer

This question was answered by @landed:

This is now fixed, I managed to get some debug by setting the joomla site to show max errors, it showed the issue was new joomla and old template. The old template was calling require_once on a non existing core file it seems. Luckily I modified (commented out the require) the line and it broke nothing else. So this is closed! Thanks if you took time to look at this.

View the original comment

The developer cloud

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

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.