Skip to content

Commit 968dc6a

Browse files
authored
Merge pull request #34 from Valian/32-resolver-variable
added RESOLVER_ADDRESS variable
2 parents d5eea55 + 457deb3 commit 968dc6a

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

Dockerfile

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
FROM openresty/openresty:alpine-fat
22

33
# allowed domains should be lua match pattern
4-
ENV DIFFIE_HELLMAN='' ALLOWED_DOMAINS='.*' AUTO_SSL_VERSION='0.13.1' FORCE_HTTPS='true' SITES='' LETSENCRYPT_URL='https://acme-v02.api.letsencrypt.org/directory'
4+
ENV DIFFIE_HELLMAN='' \
5+
ALLOWED_DOMAINS='.*' \
6+
AUTO_SSL_VERSION='0.13.1' \
7+
FORCE_HTTPS='true' \
8+
SITES='' \
9+
LETSENCRYPT_URL='https://acme-v02.api.letsencrypt.org/directory' \
10+
RESOLVER_ADDRESS='8.8.8.8'
511

612
# Here we install open resty and generate dhparam.pem file.
713
# You can specify DIFFIE_HELLMAN=true to force regeneration of that file on first run

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ 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-v01.api.letsencrypt.org/directory`, `https://acme-staging.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. |
7980

8081

8182
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):

entrypoint.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ if [ "$FORCE_HTTPS" == "true" ]; then
5858
fi
5959

6060

61-
# let's substitute $ALLOWED_DOMAINS and $LETSENCRYPT_URL into OpenResty configuration
62-
envsubst '$ALLOWED_DOMAINS,$LETSENCRYPT_URL' \
61+
# let's substitute $ALLOWED_DOMAINS, $LETSENCRYPT_URL and $RESOLVER_ADDRESS into OpenResty configuration
62+
envsubst '$ALLOWED_DOMAINS,$LETSENCRYPT_URL,$RESOLVER_ADDRESS' \
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-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ lua_shared_dict auto_ssl_settings 64k;
1414
# default DNS servers, which can be found in /etc/resolv.conf. If your network
1515
# is not IPv6 compatible, you may wish to disable IPv6 results by using the
1616
# "ipv6=off" flag (like "resolver 8.8.8.8 ipv6=off").
17-
resolver 8.8.8.8;
17+
resolver $RESOLVER_ADDRESS;
1818

1919
# Initial setup tasks.
2020
init_by_lua_block {

0 commit comments

Comments
 (0)