X-Forwarded-Proto on docker

This is rather strange, I am not sure if it is a starlette issue, but I am not sure where else it could be either. When I run starlette directly, it picks up X-Forwarded-Proto header correctly. But when I run it inside a docker container, it seems not to handle the header properly. I think this MWE more or less says it all. Am I missing something obvious?