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