nixpkgs/systems/hikari/web-development/mailhog.localhost.nix
Daniel Siepmann 6739dbf166
First roughly version of mkcert for hikari
It works, but one needs to generate them first before using them … ugly.
2023-02-05 13:32:42 +01:00

28 lines
667 B
Nix

{ pkgs, lib, config, ... }:
let
domain = "mailhog.localhost";
in {
services = {
httpd.virtualHosts.${domain} = {
forceSSL = true;
sslServerCert = "/var/projects/own/mkcert/${domain}.pem";
sslServerKey = "/var/projects/own/mkcert/${domain}-key.pem";
extraConfig = ''
RequestHeader unset Authorization
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://localhost:8025/
ProxyPassReverse / http://localhost:8025/
# Mailhog specific
<LocationMatch /api/v2/websocket>
ProxyPass ws://localhost:8025/api/v2/websocket
</LocationMatch>
'';
};
};
}