File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,23 @@ server {
1111 resolver $RESOLVERS valid=10s ipv6=off;
1212 set $upstream $UPSTREAM_HTTP_ADDRESS;
1313
14+ # Use the current host as the upstream host by default
15+ set $upstream_host $http_host;
16+
17+ # Check if our upstream address is HTTPS
18+ if ($upstream ~* ^https://([^:/]+)) {
19+ # Add these SSL configuration settings
20+ proxy_ssl_server_name on;
21+ proxy_ssl_protocols TLSv1.2 TLSv1.3;
22+ proxy_ssl_verify off;
23+
24+ # We also want to use the upstream host so SNI can be used - extract it from the upstream address
25+ set $upstream_host $1;
26+ }
27+
1428 location / {
1529 proxy_pass $upstream;
16- proxy_set_header Host $http_host ;
30+ proxy_set_header Host $upstream_host ;
1731 proxy_set_header X-Real-IP $remote_addr;
1832 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
1933 proxy_set_header X-Forwarded-Host $http_host;
You can’t perform that action at this time.
0 commit comments