nginx-proxy-manager/docker/rootfs/etc/nginx/conf.d/include/force-ssl.conf
Paul Mansfield 12b0fb47fb
Update force-ssl.conf to allow for letsencrypt directories over http
Since we have moved force-ssl.conf into the server section, it overrides the location based letsencrypt allowed over http

- Make force-ssl only work if both http traffic and outside the letsencrypt directories.
2022-05-04 17:03:38 +01:00

14 lines
496 B
Text

# 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") {
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;
}