[TLJH] How to set env vars for users _after_ but not for the spawner?

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.

Manually setting $http_proxy and $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.

But setting 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?

1 Like