Skip to content

Commit dabeb09

Browse files
committed
Update force-ssl.conf to allow for letsencrypt directories over http
1 parent bf6a32b commit dabeb09

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed
Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# Since force-ssl.conf has now moved to the server section it overrides the letsencrypt config
2+
# which is inside a ___location section
3+
# Set FORCE variable in first 2 if tests and action in the third
4+
set $FORCE "";
15
if ($scheme = "http") {
2-
return 301 https://$host$request_uri;
6+
set $FORCE 'H';
7+
}
8+
if ($request_uri !~ "^/.well-known/acme-challenge/(.*)") {
9+
set $FORCE "${FORCE}D";
10+
}
11+
# If we are http and outside the letsencrypt directories redirect via 301
12+
if ($FORCE = HD) {
13+
return 301 https://$host$request_uri;
314
}

0 commit comments

Comments
 (0)