Incorporate fix for incorrect http redirect

Incorporates fix from https://github.com/gitlabhq/gitlabhq/issues/715 to make gitlab properly redirect to https instead of http when configured for https