Skip to content

Commit 4f2ea97

Browse files
update readme, add port
1 parent 884cbcc commit 4f2ea97

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ ENV DIFFIE_HELLMAN='' \
99
LETSENCRYPT_URL='https://acme-v02.api.letsencrypt.org/directory' \
1010
STORAGE_ADAPTER='file' \
1111
REDIS_HOST='' \
12-
REDIS_DB='' \
12+
REDIS_PORT='6379' \
13+
REDIS_DB='0' \
1314
REDIS_KEY_PREFIX='' \
1415
RESOLVER_ADDRESS='8.8.8.8'
1516

README.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,13 @@ Available configuration options:
7676
| SITES | `db.com=localhost:5432; *.app.com=localhost:8080`, `_=localhost:8080` | Shortcut for defining multiple proxies, in form of `domain1=endpoint1; domain2=endpoint2`. Default template for proxy is [here](https://github.com/Valian/docker-nginx-auto-ssl/blob/master/snippets/server-proxy.conf). Name `_` means default server, just like in nginx configuration |
7777
| FORCE_HTTPS | `true`, `false` | If `true`, automatically adds location to `resty-server-http.conf` redirecting traffic from http to https. `true` by default. |
7878
| LETSENCRYPT_URL | `https://acme-v02.api.letsencrypt.org/directory`, `https://acme-staging-v02.api.letsencrypt.org/directory` | Let's Encrypt server URL to use |
79-
| RESOLVER_ADDRESS | `8.8.8.8`, `127.0.0.53` | DNS resolver used for OCSP stapling. `8.8.8.8` by default. |
80-
79+
| RESOLVER_ADDRESS | `8.8.8.8`, `127.0.0.53` | DNS resolver used for OCSP stapling. `8.8.8.8` by default. To disable ipv6 append `ipv6=off`, eg `8.8.8.8 ipv6=off` |
80+
| STORAGE_ADAPTER | `file`, `redis` | Location to store generated certificates. Best practice is `redis` in order to avoid I/O blocking in OpenResty and make the certs available across multiple containers (for a load balanced environment) . `file` by default |
81+
| REDIS_HOST | `hostname`, `ip address` | The redis host name to use for cert storage. Required if `STORAGE_ADAPTER=redis`|
82+
| REDIS_PORT | `port number` | The redis port number. `6379` by default|
83+
| REDIS_DB | `db_number` | The Redis database number used by lua-resty-auto-ssl to save certificates. `0` by default |
84+
| REDIS_KEY_PREFIX | `some-prefix` | Prefix all keys stored in Redis with this string. `''` by default |
85+
8186

8287
If you want to proxy multiple sites (probably the most common case, that's why I've made it possible to achieve without custom configuration):
8388

entrypoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ fi
5959

6060

6161
# let's substitute $ALLOWED_DOMAINS, $LETSENCRYPT_URL and $RESOLVER_ADDRESS into OpenResty configuration
62-
envsubst '$ALLOWED_DOMAINS,$LETSENCRYPT_URL,$RESOLVER_ADDRESS,$STORAGE_ADAPTER,$REDIS_HOST,$REDIS_DB,$REDIS_KEY_PREFIX' \
62+
envsubst '$ALLOWED_DOMAINS,$LETSENCRYPT_URL,$RESOLVER_ADDRESS,$STORAGE_ADAPTER,$REDIS_HOST,$REDIS_PORT,$REDIS_DB,$REDIS_KEY_PREFIX' \
6363
< ${RESTY_CONF_DIR}/resty-http.conf \
6464
> ${RESTY_CONF_DIR}/resty-http.conf.copy \
6565
&& mv ${RESTY_CONF_DIR}/resty-http.conf.copy ${RESTY_CONF_DIR}/resty-http.conf

snippets/resty-http.conf

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ init_by_lua_block {
3131
auto_ssl:set("storage_adapter", "resty.auto-ssl.storage_adapters.redis")
3232
auto_ssl:set("redis", {
3333
host = "$REDIS_HOST",
34+
port = "$REDIS_PORT",
3435
db = "$REDIS_DB",
3536
prefix = "$REDIS_KEY_PREFIX"
3637
})

0 commit comments

Comments
 (0)