public-access-proxy: match by host end

This commit is contained in:
Astro 2021-09-01 23:36:26 +02:00
parent dbccd2df17
commit 1327f465de
2 changed files with 3 additions and 3 deletions

View File

@ -81,7 +81,7 @@
};
}
{
hostNames = [ "vps1.nixvita.de" "*.vps1.www.nixvita.de" "vps1.codetu.be" "*.vps1.codetu.be" ];
hostNames = [ "vps1.nixvita.de" "vps1.codetu.be" ];
proxyTo = {
host = "172.20.73.51";
httpPort = 80;

View File

@ -100,7 +100,7 @@ in {
optionalString
(proxyHost.hostNames != [ ] && proxyHost.proxyTo.host != null)
(concatMapStringsSep "\n" (hostname: ''
use-server ${withoutWildcards hostname}-http if { req.hdr(host) -i ${hostname} }
use-server ${withoutWildcards hostname}-http if { req.hdr(host) -i -m end ${hostname} }
server ${withoutWildcards hostname}-http ${proxyHost.proxyTo.host}:${
toString proxyHost.proxyTo.httpPort
} weight 0
@ -119,7 +119,7 @@ in {
optionalString
(proxyHost.hostNames != [ ] && proxyHost.proxyTo.host != null)
(concatMapStringsSep "\n" (hostname: ''
use-server ${withoutWildcards hostname}-https if { req.ssl_sni -i ${hostname} }
use-server ${withoutWildcards hostname}-https if { req.ssl_sni -i -m end ${hostname} }
server ${withoutWildcards hostname}-https ${proxyHost.proxyTo.host}:${
toString proxyHost.proxyTo.httpsPort
} weight 0