I installed a Mule API proxy on premise on a very restricted server. In order to see if the proxy is working I tried the following from the server:
curl https://localhost:8080/console/
As expected, the proxy responded with some html:
<!doctype html>
<html lang="en">
...
<api-console-app ...>
..
When trying to send a valid request:
curl -Lv -X 'GET' 'https://localhost:8080/<basepath>/<some valid path>' -H 'accept: application/json'
It returns http code 503:
* About to connect() to localhost port 8080 (#0)
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8080 (#0)
* Initializing NSS with certpath: ...
* skipping SSL peer certificate verification
* SSL connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
* Server certificate:
* ...
> GET /...
> User-Agent: curl/7.29.0
> Host: localhost:8080
> accept: application/json
>
< HTTP/1.1 503 Service Unavailable
< Content-Type: text/plain; charset=UTF-8
< Content-Length: 0
< Date: Thu, 17 Aug 2023 17:10:48 GMT
< Connection: close
<
* Closing connection 0
Worth to mention that if I change the base path I get an 404 - not found error instead, so I'm reaching the proxy.
I can't find the error in the Mule API log or in Anypoint platform (portal).
Any ideas? How can I record/access the log for this?
You probably didn't setup the credentials so the API can connect to API Manager when executing. There is a security feature called Gatekeeper that prevents APIs not connecting to answer requests and instead returns 503 status. This is to prevent an API that is not receiving policies from API Manager from execute unsecured. You should either:
Additional references: https://help.mulesoft.com/s/article/API-returns-503-Service-Unavailable-error-to-clients