nixpkgs/systems/hikari/web-development/domains/mailhog.localhost.nix
Daniel Siepmann b2e3f46643
Extract web dev into own functions for better maintenance
Use a function for static files and TYPO3 that can be called.
That way I separate the actual domains for development from the
definition.
2023-02-07 13:53:54 +01:00

29 lines
704 B
Nix

{ pkgs, lib, config, ... }:
let
domain = "mailhog.localhost";
in {
services = {
httpd.virtualHosts.${domain} = {
forceSSL = true;
sslServerCert = "${config.custom.web-development.certFolder}${domain}.pem";
sslServerKey = "${config.custom.web-development.certFolder}${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>
'';
};
};
}