Reverse proxy support

Use request host to rewrite url for packages to enable support behind a
reverse proxy.  Proxy must pass Host header for this to work.