about summary refs log tree commit diff
path: root/profiles
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2023-05-12 15:20:38 -0700
committerFranck Cuny <franck@fcuny.net>2023-05-12 15:20:38 -0700
commit7f1e185ef933ad5e50041d3d2200de16b8460e8d (patch)
tree7f54d69679201d600c9441f0555b5c2a9c611ee9 /profiles
parentprofiles/loki: fix a few configuration errors (diff)
downloadworld-7f1e185ef933ad5e50041d3d2200de16b8460e8d.tar.gz
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.
Diffstat (limited to '')
-rw-r--r--profiles/nginx.nix9
1 files changed, 8 insertions, 1 deletions
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;
   };