Unable to get redirects working

I have a _redirects file with the following rule:

/api1/*  http://example.com:9000/api/:splat  200!
/api2/*  https://example.com:90001/api/:splat  200!

/api1/* works fine and rewrites properly to the backend api where /api2/* always give me 500 error and it is not hitting the backend.

Do we need to do anything specific while rewriting urls to https with port other than 443?

well, SSL has to work for the hostname in question. Usually HTTP 5xx errors are due to SSL not in fact being well configured at the URL (or timeouts, or other server issues on the remote site).

If you could give me the x-nf-request-id for a failing call, or the URL of your proxy that demonstrates the problem, I can look in our internal logs to try to determine what is happening.

1 Like

@fool thanks for the reply. ea2ca79e-47db-4136-b331-f71775211e80-37669284 is one of the x-nf-request-id s.

Hi, @bravokeyl, I do see there was a 500 response returned for that x-nf-request-id when an attempt was made to proxy to another site/service. The error message was:

x509: certificate signed by unknown authority

So, it was an SSL error from the proxied endpoint which caused Netlify to return the 500 response. If there are other questions about this, please let us know.

1 Like

Hi @luke, there was a mismatch of the certs. It’s working now. Thanks.