2 years ago
Hello Railway's team and users,
Context:
I have deployed the Docker image of a service running two HTTP servers:
The main service is my "business" backend, attached to the "PORT" environment variable.
The second is the administration server (analytics, healtcheck, etc.) listening on another port -> "PORT_ADMIN".
Unfortunately, in my railway.toml file, the healthcheack only seems to point to my "main" server.
I tested:
healthcheckPath="http://[MYSERVICE].railway.internal:[MYADMIN_PORT]/status"
healthcheckPath="/status"
Neither of these work.
I hope I've made myself clear and thank you in advance if you've run into this. :)
3 Replies
2 years ago
Railway will make the health request with the PORT variable, you would need to reverse proxy /status on your main service to /status on your administration server
2 years ago
Hello brody,
OK, that's what I thought.
I understand that it wouldn't really make sense to have a healthcheckHostname. But at the very least, it would be great to be able to change the port to which the health check request points. I don't know what the developers think, but in addition to healthcheckPath we could have healthcheckPort (which by default = PORT, to ensure compatibility).
Failing that, that's what I'm going to do: reverse proxy the /status request.
Thanks for your reply and for the various contributions on Github, which have given me a lot of tips. :)
2 years ago
agree, there should be a way to set a port used for the health check, but alas there isn't yet.
I'm happy to help!