Detect https scheme when serving ssl
Merge pull request #574 from scrapinghub/bugfix-endlessloop

Detect https scheme when serving ssl