diff --git a/server/server.js b/server/server.js
index 2d3f37ee..0c08da07 100644
--- a/server/server.js
+++ b/server/server.js
@@ -164,12 +164,20 @@ let needSetup = false;
// Entry Page
app.get("/", async (request, response) => {
- log.debug("entry", `Request Domain: ${request.hostname}`);
+ let hostname = request.hostname;
+ if (await setting("trustProxy")) {
+ const proxy = request.headers["x-forwarded-host"];
+ if (proxy) {
+ hostname = proxy;
+ }
+ }
+
+ log.debug("entry", `Request Domain: ${hostname}`);
- if (request.hostname in StatusPage.domainMappingList) {
+ if (hostname in StatusPage.domainMappingList) {
log.debug("entry", "This is a status page domain");
- let slug = StatusPage.domainMappingList[request.hostname];
+ let slug = StatusPage.domainMappingList[hostname];
await StatusPage.handleStatusPageResponse(response, server.indexHTML, slug);
} else if (exports.entryPage && exports.entryPage.startsWith("statusPage-")) {
diff --git a/server/uptime-kuma-server.js b/server/uptime-kuma-server.js
index e93e2b78..3362f72c 100644
--- a/server/uptime-kuma-server.js
+++ b/server/uptime-kuma-server.js
@@ -50,7 +50,6 @@ class UptimeKumaServer {
log.info("server", "Creating express and socket.io instance");
this.app = express();
-
if (sslKey && sslCert) {
log.info("server", "Server Type: HTTPS");
this.httpServer = https.createServer({
diff --git a/src/components/settings/ReverseProxy.vue b/src/components/settings/ReverseProxy.vue
index 616b0996..0fab7629 100644
--- a/src/components/settings/ReverseProxy.vue
+++ b/src/components/settings/ReverseProxy.vue
@@ -91,6 +91,51 @@
{{ $t("For example: nginx, Apache and Traefik.") }}
{{ $t("Please read") }} https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy.
+
+