Add mailhog proxy on hikari

This commit is contained in:
Daniel Siepmann 2023-02-02 17:43:44 +01:00
parent 1afd29b2b0
commit 0c98cf5144
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
2 changed files with 27 additions and 0 deletions

View file

@ -4,6 +4,8 @@
{
imports = [
./web-development/mailhog.localhost.nix
./web-development/daniel-siepmann.localhost.nix
];

View file

@ -0,0 +1,25 @@
{ pkgs, lib, config, ... }:
let
domain = "mailhog.localhost";
in {
services = {
httpd.virtualHosts.${domain} = {
# TODO: Add SSL
# forceSSL = true;
# addSSL = true;
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>
'';
};
};
}