Skip to content

Commit cc035d1

Browse files
authored
Merge pull request #14 from caprover/revert-10-https-support
Revert "Add support for HTTPS upstream, make sure to pass the upstream Host header"
2 parents bc9eeca + ec15135 commit cc035d1

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

default.conf

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,9 @@ 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-
2814
location / {
2915
proxy_pass $upstream;
30-
proxy_set_header Host $upstream_host;
16+
proxy_set_header Host $http_host;
3117
proxy_set_header X-Real-IP $remote_addr;
3218
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
3319
proxy_set_header X-Forwarded-Host $http_host;

0 commit comments

Comments
 (0)