use env to set PSGI

Alternative to #528 proposed by @veryrusty