From f537619ffef839de35914b5aaff10cb4e82c14e1 Mon Sep 17 00:00:00 2001 From: John Janzen Date: Thu, 19 Dec 2024 16:10:46 +0100 Subject: [PATCH 1/3] Revert "Change onRender function to always update the dashboard stats" This reverts commit d26e8c1d0c44a5fbeb1264f8fe713bdac0f5e703. This reopens #4204 (which i can't reproduce sadly) The reverted commit is responsible for an infinite loop of requests to /hosts, which makes buttons unresponsive on the main page another way to invalidate the cache needs to be found this infinite requests loop happens on d26e8c1d0c44a5fbeb1264f8fe713bdac0f5e703 and on the docker image `nginxproxymanager/nginx-proxy-manager-dev:pr-4206` the docker image is attaced to the pr #4206 which merges the commit --- frontend/js/app/dashboard/main.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/js/app/dashboard/main.js b/frontend/js/app/dashboard/main.js index 4765d061e..c2e82f855 100644 --- a/frontend/js/app/dashboard/main.js +++ b/frontend/js/app/dashboard/main.js @@ -50,7 +50,8 @@ module.exports = Mn.View.extend({ onRender: function () { let view = this; - Api.Reports.getHostStats() + if (typeof view.stats.hosts === 'undefined') { + Api.Reports.getHostStats() .then(response => { if (!view.isDestroyed()) { view.stats.hosts = response; @@ -60,6 +61,7 @@ module.exports = Mn.View.extend({ .catch(err => { console.log(err); }); + } }, /** From 7f9240dda79d4f0206dd5be931b4ad7eb7c2c2d1 Mon Sep 17 00:00:00 2001 From: Miguel Angel Nubla Date: Fri, 20 Dec 2024 00:59:26 +0100 Subject: [PATCH 2/3] Add custom configuration to dead_host.conf --- backend/templates/dead_host.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/templates/dead_host.conf b/backend/templates/dead_host.conf index 7a06469a9..2e7d2a007 100644 --- a/backend/templates/dead_host.conf +++ b/backend/templates/dead_host.conf @@ -22,5 +22,7 @@ server { } {% endif %} + # Custom + include /data/nginx/custom/server_dead[.]conf; } {% endif %} From 3eecf7a38b952a15feb32f648ac93569028a5254 Mon Sep 17 00:00:00 2001 From: Miguel Angel Nubla Date: Fri, 20 Dec 2024 01:03:21 +0100 Subject: [PATCH 3/3] Add custom configuration to 404 hosts --- docs/src/advanced-config/index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/src/advanced-config/index.md b/docs/src/advanced-config/index.md index c9b42bcc7..373fd08bb 100644 --- a/docs/src/advanced-config/index.md +++ b/docs/src/advanced-config/index.md @@ -181,6 +181,7 @@ You can add your custom configuration snippet files at `/data/nginx/custom` as f - `/data/nginx/custom/server_stream.conf`: Included at the end of every stream server block - `/data/nginx/custom/server_stream_tcp.conf`: Included at the end of every TCP stream server block - `/data/nginx/custom/server_stream_udp.conf`: Included at the end of every UDP stream server block + - `/data/nginx/custom/server_dead.conf`: Included at the end of every 404 server block Every file is optional.