Skip to content

Commit 6aac006

Browse files
fix: handle 401 and 403 by external auth (#9131)
1 parent c9faac2 commit 6aac006

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rootfs/etc/nginx/template/nginx.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ stream {
957957
set $proxy_upstream_name "-";
958958

959959
{{ if not ( empty $server.CertificateAuth.MatchCN ) }}
960-
{{ if gt (len $server.CertificateAuth.MatchCN) 0 }}
960+
{{ if gt (len $server.CertificateAuth.MatchCN) 0 }}
961961
if ( $ssl_client_s_dn !~ {{ $server.CertificateAuth.MatchCN }} ) {
962962
return 403 "client certificate unauthorized";
963963
}
@@ -1288,7 +1288,7 @@ stream {
12881288
{{- end }}
12891289
return
12901290
end
1291-
if res.status == ngx.HTTP_FORBIDDEN then
1291+
if res.status == ngx.HTTP_UNAUTHORIZED or res.status == ngx.HTTP_FORBIDDEN then
12921292
ngx.exit(res.status)
12931293
end
12941294
ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR)

0 commit comments

Comments
 (0)