add REDIRECT_SCHEME to support running this image behind a SSL-termination proxy
This commit is contained in:
parent
190712ffc1
commit
48724219b3
@ -33,6 +33,10 @@ ENV REDIRECT_MODE="none"
|
||||
# Which HTTP code should we use for the above redirect
|
||||
ENV REDIRECT_CODE=302
|
||||
|
||||
# And the protocol we should redirect to. Change this to "https" if you
|
||||
# serve via https (e.g. with a SSL-termination proxy infront of this)
|
||||
ENV REDIRECT_SCHEME="http"
|
||||
|
||||
ADD etc/ /etc/
|
||||
ADD usr/ /usr/
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name ~^(?!www.)(?<domain>.+)$;
|
||||
return {{REDIRECT_CODE}} https://www.$domain$request_uri;
|
||||
return {{REDIRECT_CODE}} {{REDIRECT_SCHEME}}://www.$domain$request_uri;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name ~^www.(?<domain>.+)$;
|
||||
return {{REDIRECT_CODE}} https://$domain$request_uri;
|
||||
return {{REDIRECT_CODE}} {{REDIRECT_SCHEME}}://$domain$request_uri;
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ for file in /etc/nginx/*/*.conf; do
|
||||
sed -i \
|
||||
-e "s#{{REDIRECT_CODE}}#${REDIRECT_CODE}#g" \
|
||||
-e "s#{{DOCUMENT_ROOT}}#${DOCUMENT_ROOT}#g" \
|
||||
-e "s#{{REDIRECT_SCHEME}}#${REDIRECT_SCHEME}#g" \
|
||||
"${file}"
|
||||
done
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user