|
13 | 13 | proxy_cache jwk; # Cache the JWK Set received from IdP |
14 | 14 | proxy_cache_valid 200 12h; # How long to consider keys "fresh" |
15 | 15 | proxy_cache_use_stale error timeout updating; # Use old JWK Set if cannot reach IdP |
16 | | - proxy_ssl_server_name on; # For SNI to the IdP |
| 16 | + |
| 17 | + proxy_ssl_verify on; # Enforce TLS certificate verification |
| 18 | + proxy_ssl_verify_depth 2; # Allow intermediate CA chains of depth 2 |
| 19 | + proxy_ssl_server_name on; # Send SNI to IdP host |
| 20 | + proxy_ssl_trusted_certificate /etc/ssl/certs/ca-certificates.crt; # Use system CA bundle |
| 21 | + |
17 | 22 | proxy_method GET; # In case client request was non-GET |
18 | 23 | proxy_set_header Content-Length ""; # '' |
19 | 24 | proxy_pass $oidc_jwt_keyfile; # Expecting to find a URI here |
|
43 | 48 | # Exclude client headers to avoid CORS errors with certain IdPs (e.g., Microsoft Entra ID) |
44 | 49 | proxy_pass_request_headers off; |
45 | 50 |
|
46 | | - proxy_ssl_server_name on; # For SNI to the IdP |
| 51 | + proxy_ssl_verify on; # Enforce TLS certificate verification |
| 52 | + proxy_ssl_verify_depth 2; # Allow intermediate CA chains of depth 2 |
| 53 | + proxy_ssl_server_name on; # Send SNI to IdP host |
| 54 | + proxy_ssl_trusted_certificate /etc/ssl/certs/ca-certificates.crt; # Use system CA bundle |
| 55 | + |
47 | 56 | proxy_set_header Content-Type "application/x-www-form-urlencoded"; |
48 | 57 | proxy_set_header Authorization $arg_secret_basic; |
49 | 58 | proxy_pass $oidc_token_endpoint; |
|
58 | 67 | # Exclude client headers to avoid CORS errors with certain IdPs (e.g., Microsoft Entra ID) |
59 | 68 | proxy_pass_request_headers off; |
60 | 69 |
|
61 | | - proxy_ssl_server_name on; # For SNI to the IdP |
| 70 | + proxy_ssl_verify on; # Enforce TLS certificate verification |
| 71 | + proxy_ssl_verify_depth 2; # Allow intermediate CA chains of depth 2 |
| 72 | + proxy_ssl_server_name on; # Send SNI to IdP host |
| 73 | + proxy_ssl_trusted_certificate /etc/ssl/certs/ca-certificates.crt; # Use system CA bundle |
| 74 | + |
62 | 75 | proxy_set_header Content-Type "application/x-www-form-urlencoded"; |
63 | 76 | proxy_set_header Authorization $arg_secret_basic; |
64 | 77 | proxy_pass $oidc_token_endpoint; |
|
0 commit comments