Changes to allow handyrep to be behind reverse proxy

These changes allow handyrep to run correctly behind a reverse proxy