Unverified Commit 9483ec4d authored by Jakub Skałecki's avatar Jakub Skałecki Committed by GitHub
Browse files

Merge pull request #12 from Valian/extended-regex-support

extended regex support - using ngx.re.match instead of string.match
parents 19315b57 ccfc25eb
......@@ -71,7 +71,7 @@ Available configuration options:
| Variable | Example | Description
| --- | --- | ---|
| ALLOWED_DOMAINS | `(www\|api).example.com`, `example.com`, `([a-z]+.)?example.com` | [lua pattern](http://lua-users.org/wiki/PatternsTutorial) of allowed domains. Internally, we're using `string.match`. By default we accept all domains |
| ALLOWED_DOMAINS | `(www\|api).example.com`, `example.com`, `([a-z]+.)?example.com` | Regex pattern of allowed domains. Internally, we're using [ngx.re.match](https://github.com/openresty/lua-nginx-module#ngxrematch). By default we accept all domains |
| DIFFIE_HELLMAN | `true` | Force regeneration of `dhparam.pem`. If not specified, default one is used. |
| 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 |
| FORCE_HTTPS | `true`, `false` | If `true`, automatically adds location to `resty-server-http.conf` redirecting traffic from http to https. `true` by default. |
......
......@@ -24,7 +24,7 @@ init_by_lua_block {
-- and register new certificates for. Defaults to not allowing any domains,
-- so this must be configured.
auto_ssl:set("allow_domain", function(domain)
return string.match(domain, '$ALLOWED_DOMAINS')
return ngx.re.match(domain, '$ALLOWED_DOMAINS', 'ijo')
end)
auto_ssl:init()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment