Use bburl to detect correct HTTP or HTTPS server

Prevent redirect loop with apache and nginx combination.