First part letsencrypt
This commit is contained in:
parent
08c38e5f8a
commit
10ed037d94
20 changed files with 222 additions and 45 deletions
|
|
@ -2,10 +2,16 @@
|
|||
{% for k in o["redirect"] %}
|
||||
redirect prefix {{ o["redirect"][k] }} code 301 if { hdr(host) -i {{ k }} }
|
||||
{% endfor %}
|
||||
{% for k in o["hosts"] %}
|
||||
|
||||
{%- for k in o["hosts"] %}
|
||||
{% set host = k.replace(".", "_") + "_{0}_{1}".format(o["port"], salt) %}
|
||||
{% set letsencrypt = o["hosts"][k]["letsencrypt"] %}
|
||||
|
||||
acl is_rule_{{ host }}_1 hdr(host) -i {{ k }}
|
||||
acl is_rule_{{ host }}_2 hdr(host) -i {{ k }}:{{ o["port"] }}
|
||||
{% if letsencrypt %}
|
||||
acl is_letsencrypt_{{ host }} path_beg /.well-known/acme-challenge/
|
||||
use_backend letsencrypt_backend if (is_rule_{{ host }}_1 OR is_rule_{{ host }}_2) AND is_letsencrypt_{{ host }}
|
||||
{% endif %}
|
||||
use_backend srv_{{ host }} if is_rule_{{ host }}_1 OR is_rule_{{ host }}_2
|
||||
{% endfor %}
|
||||
|
|
|
|||
|
|
@ -62,8 +62,11 @@ backend srv_{{ host }}
|
|||
option tcp-check
|
||||
tcp-check connect{{ " ssl" if o["health-check"] == "ssl" }}
|
||||
{% endif %}
|
||||
{% for c in o["hosts"][k] %}
|
||||
{% for c in o["hosts"][k]["containers"] %}
|
||||
server srv-{{ loop.index0 }} {{ c }} check weight 1{{ " verify none" if o["health-check"] == "ssl" }}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
|
||||
backend letsencrypt_backend
|
||||
server certbot 127.0.0.1:2080
|
||||
Loading…
Add table
Add a link
Reference in a new issue