Commit 6958e33
committed
Add a function for querying whether a certificate exists
We're using this to opportunistically redirect to https in the openresty proxy like so:
rewrite_by_lua_block {
local has_cert = auto_ssl:has_certificate(ngx.var.host)
if has_cert then
local https_uri = "https://" .. ngx.var.host .. ngx.var.request_uri
ngx.redirect(https_uri, 301)
end
}1 parent 9d43c23 commit 6958e33
2 files changed
+21
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
93 | 98 | | |
94 | 99 | | |
95 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
0 commit comments