From 7f1e185ef933ad5e50041d3d2200de16b8460e8d Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Fri, 12 May 2023 15:20:38 -0700 Subject: profiles/nginx: set the default port to 8080 If we don't set a default port, with `statusPage` enabled, we can't start nginx on the router, since we also need to bind to port 80 for the stream. --- profiles/nginx.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/profiles/nginx.nix b/profiles/nginx.nix index 766739b..7446cbc 100644 --- a/profiles/nginx.nix +++ b/profiles/nginx.nix @@ -2,7 +2,13 @@ { services.nginx = { enable = true; - statusPage = true; # For monitoring scraping. + + # For monitoring scraping. If we don't set a default port, it will + # by default use port 80, which will conflict with the + # configuration of the router, since we need to listen on port 80 + # too for streaming. + statusPage = true; + defaultHTTPListenPort = 8080; recommendedGzipSettings = true; recommendedOptimisation = true; @@ -12,6 +18,7 @@ services.prometheus.exporters.nginx = { enable = true; + scrapeUri = "http://127.0.0.1:${toString config.services.nginx.defaultHTTPListenPort}/nginx_status"; listenAddress = "127.0.0.1"; port = 9113; }; -- cgit 1.4.1