Skip to content

Instantly share code, notes, and snippets.

@lheckemann
Created September 17, 2018 12:23
Show Gist options
  • Save lheckemann/59295acf2a849eceebea5aab8dbe0ebd to your computer and use it in GitHub Desktop.
Save lheckemann/59295acf2a849eceebea5aab8dbe0ebd to your computer and use it in GitHub Desktop.
{pkgs, config, lib, ...}: {
services.nginx =
let mkVHost = conf: conf // {
forceSSL = true;
enableACME = true;
};
in {
enable = true;
virtualHosts = {
"virt.sphalerite.org" = mkVHost {
locations."/".index = "spice_auto.html";
locations."/".root = builtins.fetchGit {
url = https://gitlab.freedesktop.org/spice/spice-html5.git;
rev = "f9f700ee549d9d0fd08263f36bbebebe6b011789";
};
locations."/websockify" = {
proxyWebsockets = true;
proxyPass = http://localhost:5595;
};
};
};
};
systemd.services.websockify-qemu-windows = {
wantedBy = [ "multi-user.target" ];
script = ''
${pkgs.python3Packages.websockify}/bin/websockify 127.0.0.1:5595 127.0.0.1:5596
'';
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment