Refactor mirror feature

This commit is contained in:
Manuel Alejandro de Brito Fontes 2020-02-04 23:06:07 -03:00
parent b9e944a8a6
commit b3146354d4
14 changed files with 178 additions and 128 deletions

View file

@ -798,7 +798,7 @@ stream {
{{ if not (empty $server.CertificateAuth.CRLFileName) }}
# PEM sha: {{ $server.CertificateAuth.CRLSHA }}
ssl_crl {{ $server.CertificateAuth.CRLFileName }};
ssl_crl {{ $server.CertificateAuth.CRLFileName }};
{{ end }}
{{ if not (empty $server.CertificateAuth.ErrorPage)}}
@ -832,6 +832,7 @@ stream {
{{ template "CUSTOM_ERRORS" (buildCustomErrorDeps $errorLocation.UpstreamName $errorLocation.Codes $all.EnableMetrics) }}
{{ end }}
{{ buildMirrorLocations $server.Locations }}
{{ $enforceRegex := enforceRegexModifier $server.Locations }}
{{ range $location := $server.Locations }}
@ -965,8 +966,8 @@ stream {
{{ buildOpentracingForLocation $all.Cfg.EnableOpentracing $location }}
{{ if $location.Mirror.URI }}
mirror {{ $location.Mirror.URI }};
{{ if $location.Mirror.Source }}
mirror {{ $location.Mirror.Source }};
mirror_request_body {{ $location.Mirror.RequestBody }};
{{ end }}