I want to host my fastAPI
application using gunicorn
and host it on a Kubernetes Service. My Kubernetes service runs a liveness probe (health check) using HTTP
call on a specified endpoint.
I also want the application to be served on HTTPS
because my Kubernetes service exposes it to be used by external components.
Now my HTTP endpoint can't rely on redirection as the liveness probe expects a 200 Response
and redirection will hamper that.
I want to host my HTTPS endpoint on a pre-specified port as the organization has the best practices in place and the endpoint and port are specified.
Some similar problems on StackOverflow:
But both of these are okay with redirection, and we are not. And we cannot use the NGINX
server too, because that support is deprecated in my organization.