diff --git a/public/templates/index.tmpl b/public/templates/index.tmpl
index 603f2eb..297520e 100644
--- a/public/templates/index.tmpl
+++ b/public/templates/index.tmpl
@@ -41,7 +41,7 @@
{{#if serving_data}}| {{/if}}TileJSON
{{/if}}
{{#if serving_rendered}}
- | WMTS
+ | WMTS
{{/if}}
{{#if xyz_link}}
| XYZ
diff --git a/src/server.js b/src/server.js
index 9fedc02..70180d7 100644
--- a/src/server.js
+++ b/src/server.js
@@ -419,7 +419,12 @@ function start(opts) {
}
wmts.id = id;
wmts.name = (serving.styles[id] || serving.rendered[id]).name;
- wmts.baseUrl = `${req.get('X-Forwarded-Protocol') ? req.get('X-Forwarded-Protocol') : req.protocol}://${req.get('host')}`;
+ if (opts.publicUrl) {
+ wmts.baseUrl = opts.publicUrl;
+ }
+ else {
+ wmts.baseUrl = `${req.get('X-Forwarded-Protocol') ? req.get('X-Forwarded-Protocol') : req.protocol}://${req.get('host')}`;
+ }
return wmts;
});