How to debug rewrite/redirect 500 errors?

Netlify Site: https://frontend.com/
Backend Site: https://backend.com/

I have a _redirects file with the following rule:

/api/v1/* https://backend.com/api/v1/:splat 200!

When we make a request to the backend directly for example https://backend.com/api/v1/movies the request succeeds without any issues whereas https://frontend.com/api/v1/movies throws 500 error.

Is there a way to know what’s causing this issue?

Here are a few of the nf-request-ids for the failed requests

1489f94a-4ada-4b75-a790-b4ea192b39be-175696389
6387d2fe-488e-4315-b0f5-7464a6c2eab2-22014378
6387d2fe-488e-4315-b0f5-7464a6c2eab2-22019287

Hi, @bravokeyl. The 500 error in this case was because the SSL certificate using used on the proxied to service was invalid.

I’m now showing the same URL that returned a 500 status for an x-nf-request-id above is working now. Did you resolve the issue? If so, was the resolution to update the SSL certificate?

@luke Thanks for the reply.

The 500 error, in this case, was because the SSL certificate using used on the proxied to service was invalid.

May I know what was the invalid ssl cert message? It should not be an issue because we were able to access the proxied service over https(https://backend.com/) by hitting it directly.

Did you resolve the issue? If so, was the resolution to update the SSL certificate?

We were trying to setup a WAF for that it is not working temporarily we disabled, but we need to resolve it.

It would be very helpful if we can identify the issue.

Hi, @bravokeyl. The exact error message was:

x509: certificate signed by unknown authority

If our system cannot connect to the proxied resource for SSL or other reasons (anytime the connection itself fails), we will return a 500 status response for the request.

Again, it is working when I test it now, though. If there are other questions we are happy to answer.