nixpkgs/systems/hikari/web-development/mailhog.localhost.nix

29 lines
704 B
Nix
Raw Normal View History

2023-02-02 17:43:44 +01:00
{ pkgs, lib, config, ... }:
let
domain = "mailhog.localhost";
in {
services = {
2023-02-07 08:57:10 +01:00
httpd.virtualHosts.${domain} = {
forceSSL = true;
sslServerCert = "${config.custom.web-development.certFolder}${domain}.pem";
sslServerKey = "${config.custom.web-development.certFolder}${domain}-key.pem";
2023-02-02 17:43:44 +01:00
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>
'';
};
2023-02-07 08:57:10 +01:00
2023-02-02 17:43:44 +01:00
};
}