Hi,

this might be asked before, but I didn´t found the answer yet.

The following haproxy.config has the goal to use lets encrypt and https 
redirect together on a frontend.

frontend 10.10.10.10_80
    bind 10.10.10.10:80 name 10.10.10.10:80 
    mode http
    option http-keep-alive
    option log-separate-errors
    option httplog
    acl acl_1 path_beg -i /.well-known/acme-challenge/
    use_backend acme_challenge_backend if acl_1
    acl acl_2 hdr_reg(host) -i \b(?:\d{1,3}\.){3}\d{1,3}\b
    http-request redirect code 301 location https://example.com if acl_2
    acl acl_3 req.proto_http
    http-request redirect scheme https code 301 if acl_3

I thought the acls are processed from 1 to 3, but the curl result is not going 
to the acme_challenge_backend, but doing a https redirect.

$ curl -i http://example.com/.well-known/acme-challenge/<example-path>
HTTP/1.1 301 Moved Permanently
Content-length: 0
Location: https://example.com/.well-known/acme-challenge/<example-path>

What am I doing wrong? Is the acl-position in a haproxy-config not important?

Thx, Stefan

Reply via email to