Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Docker Nginx Auto Ssl
Commits
457deb37
Commit
457deb37
authored
Nov 10, 2019
by
Valian
Browse files
added and user variable in snippets #32
parent
8f7f54b8
Changes
3
Show whitespace changes
Inline
Side-by-side
Dockerfile
View file @
457deb37
FROM
openresty/openresty:alpine-fat
# allowed domains should be lua match pattern
ENV
DIFFIE_HELLMAN='' ALLOWED_DOMAINS='.*' AUTO_SSL_VERSION='0.13.1' FORCE_HTTPS='true' SITES='' LETSENCRYPT_URL='https://acme-v02.api.letsencrypt.org/directory'
ENV
DIFFIE_HELLMAN='' \
ALLOWED_DOMAINS='.*' \
AUTO_SSL_VERSION='0.13.1' \
FORCE_HTTPS='true' \
SITES='' \
LETSENCRYPT_URL='https://acme-v02.api.letsencrypt.org/directory' \
RESOLVER_ADDRESS='8.8.8.8'
# Here we install open resty and generate dhparam.pem file.
# You can specify DIFFIE_HELLMAN=true to force regeneration of that file on first run
...
...
entrypoint.sh
View file @
457deb37
...
...
@@ -58,8 +58,8 @@ if [ "$FORCE_HTTPS" == "true" ]; then
fi
# let's substitute $ALLOWED_DOMAINS
and
$LETSENCRYPT_URL into OpenResty configuration
envsubst
'$ALLOWED_DOMAINS,$LETSENCRYPT_URL'
\
# let's substitute $ALLOWED_DOMAINS
,
$LETSENCRYPT_URL
and $RESOLVER_ADDRESS
into OpenResty configuration
envsubst
'$ALLOWED_DOMAINS,$LETSENCRYPT_URL
,$RESOLVER_ADDRESS
'
\
<
${
RESTY_CONF_DIR
}
/resty-http.conf
\
>
${
RESTY_CONF_DIR
}
/resty-http.conf.copy
\
&&
mv
${
RESTY_CONF_DIR
}
/resty-http.conf.copy
${
RESTY_CONF_DIR
}
/resty-http.conf
...
...
snippets/resty-http.conf
View file @
457deb37
...
...
@@ -14,7 +14,7 @@ lua_shared_dict auto_ssl_settings 64k;
# default DNS servers, which can be found in /etc/resolv.conf. If your network
# is not IPv6 compatible, you may wish to disable IPv6 results by using the
# "ipv6=off" flag (like "resolver 8.8.8.8 ipv6=off").
resolver
8
.
8
.
8
.
8
;
resolver
$
RESOLVER_ADDRESS
;
# Initial setup tasks.
init_by_lua_block
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment