Skip to content

secondary domain not getting auto renewed #305

@tanpsingh

Description

@tanpsingh

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()
      }
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions