auto-ssl / auto-ssl/lua-resty-auto-ssl

Please provide instructions on how to install resty-auto-ssl for use with virtual hosts

Open
#99 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Lua
Stars
2k
Forks
184
PR merge metrics
No merged PRs in 30d

Description

Is it possible? I have my `openresty` configured like this:

`nginx.conf`:

http {
lua_shared_dict auto_ssl 1m;
lua_shared_dict auto_ssl_settings 64k;

resolver 8.8.4.4 8.8.8.8;

init_by_lua_block {
auto_ssl = (require "resty.auto-ssl").new()
auto_ssl:set("dir", "/usr/local/openresty/nginx/conf/autossl")
auto_ssl:set("storage_adapter", "resty.auto-ssl.storage_adapters.redis")
auto_ssl:set("redis", { socket = "/var/run/redis/redis.sock" })
auto_ssl:set("allow_domain", function(domain)
return true
end)
auto_ssl:init()
}

init_worker_by_lua_block {
auto_ssl:init_worker()
}

ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;

include /usr/local/openresty/nginx/conf/sites-enabled/*.conf;
}

`sites-enabled/domain1.tld.conf`:

server {
listen 80;
listen [::]:80;
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name domain1.tld;

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;

ssl_certificate_by_lua_block {
auto_ssl:ssl_certificate()
}

location /.well-known/acme-challenge/ {
content_by_lua_block {
auto_ssl:challenge_server()
}
}

ssl_certificate /usr/local/openresty/nginx/conf/autossl/resty-auto-ssl-fallback.crt;
ssl_certificate_key /usr/local/openresty/nginx/conf/autossl/resty-auto-ssl-fallback.key;
}

server {
listen 80;
listen [::]:80;
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name www.domain1.tld;
return 301 $scheme://domain1.tld$request_uri;

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;

ssl_certificate_by_lua_block {
auto_ssl:ssl_certificate()
}

location /.well-known/acme-challenge/ {
content_by_lua_block {
auto_ssl:challenge_server()
}
}

ssl_certificate /usr/local/openresty/nginx/conf/autossl/resty-auto-ssl-fallback.crt;
ssl_certificate_key /usr/local/openresty/nginx/conf/autossl/resty-auto-ssl-fallback.key;
}

And similar configuration for each virtual host. What should I change in my configuration to get certificates from let's encrypt?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the nginx.conf and sites-enabled/domain1.tld.conf examples included in the issue. Compare the repeated virtual-host configuration with the project's existing installation and virtual-host guidance, then document the required changes and a way to verify that Let's Encrypt certificates are issued for each host.

Written by the indexing model from the issue text.

Assessment

Tech stack
nginx
Domain
devops, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.