Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update force-ssl.conf #3325

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion docker/rootfs/etc/nginx/conf.d/include/force-ssl.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# Since force-ssl.conf has now moved to the server section it overrides the letsencrypt config
# which is inside a location section
# Set FORCE variable in first 2 if tests and action in the third
set $FORCE "";
if ($scheme = "http") {
return 301 https://$host$request_uri;
set $FORCE 'H';
}
if ($request_uri !~ "^/.well-known/acme-challenge/(.*)") {
set $FORCE "${FORCE}D";
}
# If we are http and outside the letsencrypt directories redirect via 301
if ($FORCE = HD) {
return 301 https://$host$request_uri;
}