Quantcast
Channel: Active questions tagged https - Stack Overflow
Viewing all articles
Browse latest Browse all 1535

How can we run a FastAPI application on two ports one HTTP and one HTTPS without redirecting?

$
0
0

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:

  1. Running Gunicorn on both http and https
  2. uvicorn [fastapi] python run both HTTP and HTTPS

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.


Viewing all articles
Browse latest Browse all 1535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>