public-access-proxy: fix wildcard matches
This commit is contained in:
parent
b1ae3b6013
commit
dbccd2df17
|
@ -3,6 +3,8 @@
|
|||
with lib;
|
||||
let cfg = config.my.services.proxy;
|
||||
|
||||
withoutWildcards = builtins.replaceStrings ["*"] ["all"];
|
||||
|
||||
in {
|
||||
|
||||
options.my.services.proxy = {
|
||||
|
@ -98,8 +100,8 @@ in {
|
|||
optionalString
|
||||
(proxyHost.hostNames != [ ] && proxyHost.proxyTo.host != null)
|
||||
(concatMapStringsSep "\n" (hostname: ''
|
||||
use-server ${hostname}-http if { req.hdr(host) -i ${hostname} }
|
||||
server ${hostname}-http ${proxyHost.proxyTo.host}:${
|
||||
use-server ${withoutWildcards hostname}-http if { req.hdr(host) -i ${hostname} }
|
||||
server ${withoutWildcards hostname}-http ${proxyHost.proxyTo.host}:${
|
||||
toString proxyHost.proxyTo.httpPort
|
||||
} weight 0
|
||||
'') (proxyHost.hostNames))) (cfg.proxyHosts)
|
||||
|
@ -117,8 +119,8 @@ in {
|
|||
optionalString
|
||||
(proxyHost.hostNames != [ ] && proxyHost.proxyTo.host != null)
|
||||
(concatMapStringsSep "\n" (hostname: ''
|
||||
use-server ${hostname}-https if { req.ssl_sni -i ${hostname} }
|
||||
server ${hostname}-https ${proxyHost.proxyTo.host}:${
|
||||
use-server ${withoutWildcards hostname}-https if { req.ssl_sni -i ${hostname} }
|
||||
server ${withoutWildcards hostname}-https ${proxyHost.proxyTo.host}:${
|
||||
toString proxyHost.proxyTo.httpsPort
|
||||
} weight 0
|
||||
'') (proxyHost.hostNames))) (cfg.proxyHosts)
|
||||
|
|
Loading…
Reference in New Issue