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

May 23, 2018 93 views
Nginx Ubuntu 16.04
landed
By:
landed

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.

1 comment
  • 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.

1 Answer
ryanpq MOD May 25, 2018
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

Have another answer? Share your knowledge.