]>
Commit | Line | Data |
---|---|---|
bfe3c9c9 | 1 | { env }: |
940f1834 IB |
2 | let |
3 | ympd = rec { | |
4 | config = { | |
bfe3c9c9 | 5 | webPort = "localhost:${env.listenPort}"; |
914dd76c IB |
6 | host = env.mpd.host; |
7 | port = env.mpd.port; | |
940f1834 IB |
8 | }; |
9 | apache = { | |
10 | modules = [ | |
11 | "proxy_wstunnel" | |
12 | ]; | |
13 | vhostConf = '' | |
e229e6f2 | 14 | <LocationMatch "^/mpd(?!/music.(mp3|ogg))"> |
940f1834 IB |
15 | Use LDAPConnect |
16 | Require ldap-group cn=users,cn=mpd,ou=services,dc=immae,dc=eu | |
940f1834 IB |
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> | |
e229e6f2 IB |
28 | <Location "/mpd/music.mp3"> |
29 | ProxyPass http://localhost:${env.mp3port}/ | |
30 | ProxyPassReverse http://localhost:${env.mp3port}/ | |
31 | </Location> | |
32 | <Location "/mpd/music.ogg"> | |
33 | ProxyPass http://localhost:${env.oggport}/ | |
34 | ProxyPassReverse http://localhost:${env.oggport}/ | |
35 | </Location> | |
940f1834 IB |
36 | ''; |
37 | }; | |
38 | }; | |
39 | in | |
40 | ympd |