{ config, lib, ... }:
let
cfg = config.myServices.websites.tools.im;
in
{
options.myServices.websites.tools.im = {
enable = lib.mkEnableOption "enable im website";
};
config = lib.mkIf cfg.enable {
services.websites.env.tools.vhostConfs.im = {
certName = "eldiron";
addToCerts = true;
hosts = ["im.immae.fr"];
root = ./www;
extraConfig = [
''
Alias /converse ${./www}/converse.html
ProxyPreserveHost On
ProxyPass http://localhost:5280/bosh
ProxyPassReverse http://localhost:5280/bosh
ProxyPass ws://localhost:5280/ws
ProxyPass /upload http://localhost:5280/upload
ProxyPassReverse /upload http://localhost:5280/upload
ProxyPass /admin http://localhost:5280/admin
ProxyPassReverse /admin http://localhost:5280/admin
ProxyPass /api http://localhost:5280/api
ProxyPassReverse /api http://localhost:5280/api
''
];
};
};
}