]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - virtual/modules/websites/tools/tools/ympd.nix
Add rompr
[perso/Immae/Config/Nix.git] / virtual / modules / websites / tools / tools / ympd.nix
1 { env }:
2 let
3 ympd = rec {
4 config = {
5 webPort = "localhost:${env.listenPort}";
6 mpd = env.mpd;
7 };
8 apache = {
9 modules = [
10 "proxy_wstunnel"
11 ];
12 vhostConf = ''
13 <LocationMatch "^/mpd">
14 Use LDAPConnect
15 Require ldap-group cn=users,cn=mpd,ou=services,dc=immae,dc=eu
16 Require local
17 </LocationMatch>
18
19 RedirectMatch permanent "^/mpd$" "/mpd/"
20 <Location "/mpd/">
21 ProxyPass http://${config.webPort}/
22 ProxyPassReverse http://${config.webPort}/
23 ProxyPreserveHost on
24 </Location>
25 <Location "/mpd/ws">
26 ProxyPass ws://${config.webPort}/ws
27 </Location>
28 '';
29 };
30 };
31 in
32 ympd