use the proxy's url if available

When a PSGI app is used behind a reverse proxy the the URL that the client uses can be different from the app's URL, which will normally break digest auth.

Here's a small fix that solves my setup, maybe this fix could be made more generic?