diff --git a/internal/configs/version2/nginx-plus.virtualserver.tmpl b/internal/configs/version2/nginx-plus.virtualserver.tmpl index c217c08c49..7cd2da4a20 100644 --- a/internal/configs/version2/nginx-plus.virtualserver.tmpl +++ b/internal/configs/version2/nginx-plus.virtualserver.tmpl @@ -254,23 +254,9 @@ server { {{- end }} {{- with $s.APIKey}} - # API KEY POLICY - # not supplied: {{ .RejectCodeNotSupplied }} - # no match: {{ .RejectCodeNoMatch }} - js_var $apikey_auth_local_map "{{ .MapName}}"; js_var $apikey_auth_token $apikey_auth_hash; auth_request /_validate_apikey_njs; - {{- range $header := .Header}} - # header: {{ $header }} - {{- end -}} - {{- range $query := .Query }} - # query: {{ $query }} - {{- end -}} - {{- range $client := .Clients }} - # client: {{ $client.ClientID }} - # secret: {{ $client.EncryptedKey }} - {{- end }} {{- end }} {{- with $s.WAF }} @@ -474,25 +460,10 @@ server { {{- with $l.APIKey}} - # API KEY POLICY - # not supplied: {{ .RejectCodeNotSupplied }} - # no match: {{ .RejectCodeNoMatch }} - set $apikey_auth_local_map "{{ .MapName }}"; set $header_query_value {{ makeHeaderQueryValue $l.APIKey | printf }}; set $apikey_auth_token $apikey_auth_hash; auth_request /_validate_apikey_njs; - - {{- range $header := .Header}} - # header: {{ $header }} - {{- end -}} - {{- range $query := .Query }} - # query: {{ $query }} - {{- end -}} - {{- range $client := .Clients }} - # client: {{ $client.ClientID }} - # secret: {{ $client.EncryptedKey }} - {{- end }} {{- else }} {{- with $s.APIKey }} set $header_query_value {{ makeHeaderQueryValue $s.APIKey | printf }}; diff --git a/internal/configs/version2/nginx.virtualserver.tmpl b/internal/configs/version2/nginx.virtualserver.tmpl index a1b527f5fb..7e22b35d68 100644 --- a/internal/configs/version2/nginx.virtualserver.tmpl +++ b/internal/configs/version2/nginx.virtualserver.tmpl @@ -156,25 +156,9 @@ server { {{- end }} {{- with $s.APIKey}} - # API KEY POLICY - # not supplied: {{ .RejectCodeNotSupplied }} - # no match: {{ .RejectCodeNoMatch }} - js_var $apikey_auth_local_map "{{ .MapName}}"; js_var $apikey_auth_token $apikey_auth_hash; auth_request /_validate_apikey_njs; - - - {{- range $header := .Header}} - # header: {{ $header }} - {{- end -}} - {{- range $query := .Query }} - # query: {{ $query }} - {{- end -}} - {{- range $client := .Clients }} - # client: {{ $client.ClientID }} - # secret: {{ $client.EncryptedKey }} - {{- end }} {{- end }} {{- with $s.EgressMTLS }} @@ -285,25 +269,11 @@ server { {{- end }} {{- with $l.APIKey}} - # API KEY POLICY - # not supplied: {{ .RejectCodeNotSupplied }} - # no match: {{ .RejectCodeNoMatch }} - set $apikey_auth_local_map "{{ .MapName }}"; set $header_query_value {{ makeHeaderQueryValue $l.APIKey | printf }}; set $apikey_auth_token $apikey_auth_hash; auth_request /_validate_apikey_njs; - {{- range $header := .Header}} - # header: {{ $header }} - {{- end -}} - {{- range $query := .Query }} - # query: {{ $query }} - {{- end -}} - {{- range $client := .Clients }} - # client: {{ $client.ClientID }} - # secret: {{ $client.EncryptedKey }} - {{- end }} {{- else }} {{- with $s.APIKey }} set $header_query_value {{ makeHeaderQueryValue $s.APIKey | printf }};