We have a setup where the machine running TLJH (but I guess this is true for arbitrary JupyterHubs) behind a firewall that blocks all outgoing http(s) and provides a proxy for these protocols.
$https_proxy after the user server started, correctly enables all outgoing HTTP(S) connections.
Setting the env vars in the JupyterHub config via the
c.Spawner.environment dict (as suggested in this comment) works for setting arbitrary env vars.
http_proxy in the spawner config seems to break the communication of the jupyter-user-server with the proxy of the hub (guessing here) and leads to a
502 bad gateway error after the user server is spawned.
So my question is: Is there a TLJH way to define env variables for the users that does not affect the spawner?