Closed sandeep-gh closed 9 months ago
Thanks for reaching out! The https can be taken from the X-Forwarded-Porto
. This looks right. I would limit the source IPs to match the IP from your nginx proxy server. This should not matter in this case but will follow the best practice.
We will need to dig into the framework and see why it is not doing the right thing.
Are you able to share an example application using a very minimalistic setup?
I will check it later so we can test it later
My setup is following: a starlette app is driven by unit which is sitting behind nginx server.
What I need that starlette api request.url_for to resolve to https address instead of http. When starlette is hosted by uvicorn server, the config required is
as described here ,
How to achieve the same for the nginx-unit setup: I have following in nginx.conf file:
and following on unit configuration
There have several discussions on starlette as well, so this seems involved. I can provide more links if needed.