1

While working on an API written with flask and flask restplus, I have had an issue. Indeed, I need to do an action which is asynchronous, so I return a http response with a status code 202 and a Location header: /api/tasks/{id}. Flask takes this path and add the host in front of it, so we receive something like this: http://host/api/tasks/{id}. The issue is that the host is always in http, even if the api is in a kubernetes cluster with nginx ingress, and launched with gunicorn, and https is activated within the k8s cluster. Does someone has an idea of how I can return the location, but with https?

I have tried https://marcolenzo.eu/2019/12/01/enable-x-forwarded-headers-in-kubernetes-nginx-ingress-controller/

Thanks for your help.

Krishna Chaurasia
  • 8,924
  • 6
  • 22
  • 35
ocheriaf
  • 580
  • 3
  • 11

0 Answers0