blob: 82d9321d1d77b53454ed17181f9a5eb668d80680 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
{ env }:
let
ympd = rec {
config = {
webPort = "localhost:${env.listenPort}";
host = env.mpd.host;
port = env.mpd.port;
};
apache = {
modules = [
"proxy_wstunnel"
];
vhostConf = ''
<LocationMatch "^/mpd(?!/music.(mp3|ogg))">
Use LDAPConnect
Require ldap-group cn=users,cn=mpd,ou=services,dc=immae,dc=eu
</LocationMatch>
RedirectMatch permanent "^/mpd$" "/mpd/"
<Location "/mpd/">
ProxyPass http://${config.webPort}/
ProxyPassReverse http://${config.webPort}/
ProxyPreserveHost on
</Location>
<Location "/mpd/ws">
ProxyPass ws://${config.webPort}/ws
</Location>
<Location "/mpd/music.mp3">
ProxyPass http://localhost:${env.mp3port}/
ProxyPassReverse http://localhost:${env.mp3port}/
</Location>
<Location "/mpd/music.ogg">
ProxyPass http://localhost:${env.oggport}/
ProxyPassReverse http://localhost:${env.oggport}/
</Location>
'';
};
};
in
ympd
|