diff --git a/apps/user_webfinger/host-meta.php b/apps/user_webfinger/host-meta.php
index c3d6f0ed2ca0cbcc927ce46824d1c5947741c8fd..285caaa1278f4991aedd8fb9aad07cb771f84994 100644
--- a/apps/user_webfinger/host-meta.php
+++ b/apps/user_webfinger/host-meta.php
@@ -19,7 +19,7 @@ if(isset($_SERVER['HTTPS'])) {
 $lrddTmpl .= '://' . $serverName . $webRoot . '/public.php?service=webfinger&q={uri}';
 $hostMetaPath = $docRoot . '/.well-known/host-meta';
 $hostMetaDir = $docRoot . '/.well-known';
-$hostMetaContents = "{\"links\":[{\"rel\":\"lrdd\",\"template\":\"http://mich.oc/public.php?service=webfinger&q={uri}\"}]}";
+$hostMetaContents = "{\"links\":[{\"rel\":\"lrdd\",\"template\":\"http'.(isset($_SERVER['HTTPS'])?'s':'').'://'.$serverName.'/public.php?service=webfinger&q={uri}\"}]}";
 foreach($hostMetaHeader as $header => $value) {
 	header($header . ": " . $value);
 }