Browse Source

pulsebert: let caddy accept any vhost, redirect to https://mpd.hq.c3d2.de

Fixes Github issue #1
container/radius
Astro 1 year ago
parent
commit
ffd0e8720a
1 changed files with 12 additions and 4 deletions
  1. 12
    4
      hosts/pulsebert/configuration.nix

+ 12
- 4
hosts/pulsebert/configuration.nix View File

@@ -4,7 +4,10 @@
4 4
 
5 5
 { config, pkgs, ... }:
6 6
 
7
-{
7
+let
8
+  ympdPort = 8080;
9
+  mpdVhost = "mpd.hq.c3d2.de";
10
+in {
8 11
   imports =
9 12
     [ # Include the results of the hardware scan.
10 13
       ./hardware-configuration.nix
@@ -176,8 +179,13 @@
176 179
     agree = true;
177 180
     # TODO: add auth?
178 181
     config = ''
179
-        mpd.hq.c3d2.de
180
-        proxy / localhost:8080
182
+        ${mpdVhost} {
183
+          proxy / localhost:${toString ympdPort}
184
+        }
185
+
186
+        :80 {
187
+          redir https://${mpdVhost}{uri}
188
+        }
181 189
     '';
182 190
   };
183 191
 
@@ -196,7 +204,7 @@
196 204
   # MPD music playing daemon with webinterface
197 205
   services.ympd = {
198 206
     enable = true;
199
-    webPort = "8080";
207
+    webPort = toString ympdPort;
200 208
   };
201 209
   
202 210
 }

Loading…
Cancel
Save