Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow users to configure which db of redis to use #103

Merged
merged 2 commits into from
Jan 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ Additional configuration options can be set on the `auto_ssl` instance that is c
- `port`
- `socket` (for unix socket paths)
- `auth`
- `db` (the number of db auto-ssl used to save certificates)
- `prefix`

*Example:*
Expand Down
7 changes: 7 additions & 0 deletions lib/resty/auto-ssl/storage_adapters/redis.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ local function get_redis_instance(self)
end
end

if self.options["db"] then
ok, err = instance:select(self.options["db"])
if not ok then
return false, err
end
end

ngx.ctx.auto_ssl_redis_instance = instance
return instance
end
Expand Down