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
884cbcc5
Commit
884cbcc5
authored
May 25, 2020
by
Sebastian Macarescu
Browse files
add basic redis
parent
cfca129c
Changes
4
Show whitespace changes
Inline
Side-by-side
.gitattributes
0 → 100644
View file @
884cbcc5
*.sh text eol=lf
\ No newline at end of file
Dockerfile
View file @
884cbcc5
...
...
@@ -7,6 +7,10 @@ ENV DIFFIE_HELLMAN='' \
FORCE_HTTPS='true' \
SITES='' \
LETSENCRYPT_URL='https://acme-v02.api.letsencrypt.org/directory' \
STORAGE_ADAPTER='file' \
REDIS_HOST='' \
REDIS_DB='' \
REDIS_KEY_PREFIX='' \
RESOLVER_ADDRESS='8.8.8.8'
# Here we install open resty and generate dhparam.pem file.
...
...
entrypoint.sh
View file @
884cbcc5
...
...
@@ -59,7 +59,7 @@ fi
# let's substitute $ALLOWED_DOMAINS, $LETSENCRYPT_URL and $RESOLVER_ADDRESS into OpenResty configuration
envsubst
'$ALLOWED_DOMAINS,$LETSENCRYPT_URL,$RESOLVER_ADDRESS'
\
envsubst
'$ALLOWED_DOMAINS,$LETSENCRYPT_URL,$RESOLVER_ADDRESS
,$STORAGE_ADAPTER,$REDIS_HOST,$REDIS_DB,$REDIS_KEY_PREFIX
'
\
<
${
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 @
884cbcc5
# The "auto_ssl" shared dict should be defined with enough storage space to
# hold your certificate data. 1MB of storage holds certificates for
# approximately 100 separate domains.
lua_shared_dict
auto_ssl
1
m
;
lua_shared_dict
auto_ssl
1
0
m
;
# The "auto_ssl" shared dict is used to temporarily store various settings
# like the secret used by the hook server on port 8999. Do not change or
...
...
@@ -27,6 +27,15 @@ init_by_lua_block {
return
ngx
.
re
.
match
(
domain
,
'$ALLOWED_DOMAINS'
,
'ijo'
)
end
)
if
"$STORAGE_ADAPTER"
==
"redis"
then
auto_ssl
:
set
(
"storage_adapter"
,
"resty.auto-ssl.storage_adapters.redis"
)
auto_ssl
:
set
(
"redis"
, {
host
=
"$REDIS_HOST"
,
db
=
"$REDIS_DB"
,
prefix
=
"$REDIS_KEY_PREFIX"
})
end
auto_ssl
:
init
()
}
...
...
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