Skip to content
Discussion options

You must be logged in to vote

@Reapor-Yurnero

uvicorn handles trailing slash redirects by default, you can disable this by passing redirect_slashes=False to your APIRouter.

Given your proxy is communicating with uvicorn via HTTP, it will naturally redirect to the same scheme (http). As @SebastianLuebke mentioned, uvicorn* does honor the X-FORWARDED-PROTO if enabled. It is enabled by default, and will only populate this information for trusted clients, which are supplied to uvicorn via the command line, or an environment variable:

  --forwarded-allow-ips TEXT      Comma seperated list of IPs to trust with
                                  proxy headers. Defaults to the
                                  $FORWARDED_ALLOW…

Replies: 13 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Kludex
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
5 participants
Converted from issue

This discussion was converted from issue #2033 on February 28, 2023 00:54.