diff options
Diffstat (limited to 'virtual/modules/websites/tools/tools/ympd.nix')
-rw-r--r-- | virtual/modules/websites/tools/tools/ympd.nix | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/virtual/modules/websites/tools/tools/ympd.nix b/virtual/modules/websites/tools/tools/ympd.nix new file mode 100644 index 0000000..74bf2e5 --- /dev/null +++ b/virtual/modules/websites/tools/tools/ympd.nix | |||
@@ -0,0 +1,35 @@ | |||
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 | ||