diff --git a/VIPSWeb/local_settings_sample.py b/VIPSWeb/local_settings_sample.py
index b2a9ae4f396f86b77d4753011e00f9843f391870..3933e7eee77fb29ba3e44fa12a0504fbdb9ca30c 100755
--- a/VIPSWeb/local_settings_sample.py
+++ b/VIPSWeb/local_settings_sample.py
@@ -118,6 +118,9 @@ GOOGLE_ANALYTICS_SCRIPT = """
 </script>
 """
 
+# Convenience method for building URL to self
+VIPSWEB_PROTOCOL = "https"
+
 # The server hostname used for VIPSLogic
 VIPSLOGIC_SERVER_NAME = "vipslogic"
 # VIPSLogic protocol (http or https)
diff --git a/VIPSWeb/templates/base.html b/VIPSWeb/templates/base.html
index 20ce4ecd5f64c81a0f6ef15a3048cd3dad9b78bd..5cae714a8e9efe91b5fe6e8284760ccf2a44bf48 100755
--- a/VIPSWeb/templates/base.html
+++ b/VIPSWeb/templates/base.html
@@ -99,7 +99,7 @@
 					<span class="fa fa-sign-out"></span>
 					</a>
 				{% else %}
-						<a href="{{settings.VIPSLOGIC_PROTOCOL}}://{{settings.VIPSLOGIC_SERVER_NAME}}/login?nextPage={{"http://" | urlencode}}{{request.get_host|urlencode}}&returnUUID=true" class="signinLink">{% trans "Sign in" %}</a>
+						<a href="{{settings.VIPSLOGIC_PROTOCOL}}://{{settings.VIPSLOGIC_SERVER_NAME}}/login?nextPage={{settings.VIPSWEB_PROTOCOL}}{{"://" | urlencode}}{{request.get_host|urlencode}}&returnUUID=true" class="signinLink">{% trans "Sign in" %}</a>
 				{% endif %}
 				</div>
 			  </div>