user5583935
user5583935

Reputation:

Nginx 500 error page without any error log

I am getting "500 internal server error". But, there is no error log anywhere. I am running ubuntu trusty via vagrant+virtual box on macOS Sierra. enter image description here

Upvotes: 0

Views: 6292

Answers (3)

vynhart
vynhart

Reputation: 1

I was once having the similar problem, let me try to give you an approach to find the root cause.

First, check nginx error log. Usually it's on /var/log/nginx/error.log, you may get a clue about what happened. If there is no error found, try to make the HTTP request again and see if it's logged on /var/log/nginx/access.log. If the request is logged on access.log with 500 error response, it indicates that Nginx succesfully forwarded the HTTP request to the next layer (I assume you're using php-fpm).

Second, check the php-fpm error log. Usually it's on /var/log/phpX.X-fpm.log to see if there is any clue in there.

Last, if you don't see any error in that file too, then most likely the error exists in the PHP app. In my case, when I was using Laravel, it was because the .env file couldn't be parsed due to I mistakenly put random text. When error happened on the very early lifecycle of the app, sometimes it's so hard to be found because it doesn't even get into the logging mechanism yet.

Upvotes: 0

Alex
Alex

Reputation: 1030

if magento is configured to write error log in a file but not to transfer error stack trace to nginx -- in this case nginx error log will be empty. i would suggest to check magento config about that. at least in php-fpm we have as i described

Upvotes: 0

Chuongnh
Chuongnh

Reputation: 11

According here https://www.digitalocean.com/community/questions/how-to-fix-an-unknown-internal-server-error-500-nginx-is-giving-me Remove the line that set custom log location, and check log in default location (/var/log/nginx) might help.

Upvotes: 1

Related Questions