auto-ssl / auto-ssl/lua-resty-auto-ssl
secondary domain not getting auto renewed
- Dominant language
- Lua
- Stars
- 2k
- Forks
- 184
- PR merge metrics
- No merged PRs in 30d
Description
In our env, some clients have a primary domain as **client.com**, and they also have a secondary domain such as **www.client.com**, which redirects to the primary domain. Resty auto SSL usually generates a separate certificate for both domains; however, it only renews the certificate for the primary domain, but not the secondary domain.
What could be the issue here? We are not seeing any error, also in the openresty logs.
```
lua_package_path "/usr/local/openresty/luajit/share/lua/5.1/?.lua;;";
lua_shared_dict auto_ssl 100m;
lua_shared_dict auto_ssl_settings 64k;
resolver 8.8.8.8 ipv6=off;
init_by_lua_block {
auto_ssl = (require "resty.auto-ssl").new()
auto_ssl:set("allow_domain", function(domain)
return true
end)
auto_ssl:init()
}
init_worker_by_lua_block {
auto_ssl:init_worker()
}
server {
listen 443 ssl default_server;
ssl_certificate_by_lua_block {
auto_ssl:ssl_certificate()
}
ssl_certificate /etc/letsencrypt/live/mydomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mydomain.com/privkey.pem;
server {
listen 80 default_server;
location /.well-known/acme-challenge/ {
content_by_lua_block {
auto_ssl:challenge_server()
}
}
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 127.0.0.1:8999;
client_body_buffer_size 128k;
client_max_body_size 128k;
location / {
content_by_lua_block {
auto_ssl:hook_server()
}
}
}
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reviewing the provided OpenResty/nginx configuration and the resty.auto-ssl initialization, challenge, certificate, and worker entry points. Reproduce renewal for a primary and secondary domain while checking the relevant OpenResty logs. Done means identifying why the secondary certificate is not renewed and documenting a verified configuration or behavior fix.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua, nginx
- Domain
- security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100