added support for webroot and https - this is for reverse proxy setups