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

Fixes Github issue #1
This commit is contained in:
Astro 2019-02-13 19:13:22 +01:00 committed by k-ot
parent 9627ebe6d3
commit ffd0e8720a
1 changed files with 12 additions and 4 deletions

View File

@ -4,7 +4,10 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ let
ympdPort = 8080;
mpdVhost = "mpd.hq.c3d2.de";
in {
imports = imports =
[ # Include the results of the hardware scan. [ # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
@ -176,8 +179,13 @@
agree = true; agree = true;
# TODO: add auth? # TODO: add auth?
config = '' config = ''
mpd.hq.c3d2.de ${mpdVhost} {
proxy / localhost:8080 proxy / localhost:${toString ympdPort}
}
:80 {
redir https://${mpdVhost}{uri}
}
''; '';
}; };
@ -196,7 +204,7 @@
# MPD music playing daemon with webinterface # MPD music playing daemon with webinterface
services.ympd = { services.ympd = {
enable = true; enable = true;
webPort = "8080"; webPort = toString ympdPort;
}; };
} }