I'm having trouble with a reverse-proxy config and could use some assistance.

We have the following setup:

LOAD BALANCER
Accepts requests via the official hostname and HTTPS (port 443)
Forwards requests to Devpi Nginx server
Sends headers X-Forwaded-Port, X-Forwarded-Host, X-Forwarded-Proto matching the official hostname, HTTPS, and 443.

DEVPI NGINX SERVER
Accepts requests via port 80
Serves requests for +f files directly (works perfectly)
Forwards remaining requests to Devpi Python server
DOES NOT override headers X-Forwaded-Port, X-Forwarded-Host, X-Forwarded-Proto (I have those proxy_set_header values from the recommended nginx.conf commented out so that Nginx doesn't override them)
DOES NOT send header X-Outside-Url (I also have that commented out)

The behavior is that all links, CSS tags, and JavaScript tags point to http://localhost/... instead of https://the.correct.domain.name/...

What do I need to change to make Devpi properly use the X-Forwaded-Port, X-Forwarded-Host, X-Forwarded-Proto headers coming from the load balancer?

Thanks,

Nick