Hi,

consultor <[email protected]> [2021-01-05 18:43:26 -0800]:
>works correctly with the main domain, but not with the second

>server "consultores.ca/ENA" {
>server "consultores.ca" {

These are not different domains. The domain part is ‘consultores.ca’.

If you would like requests made to consultores.ca/ENA/* to be served
from a different directory, you could do this, employing more location
blocks:

server "consultores.ca" {
        listen on * port 80
        root "/htdocs/consultores/"
        location "/.well-known/acme-challenge/*" {
                root "/acme"
                request strip 2
        }
        location * {
                block return 302 "https://$HTTP_HOST$REQUEST_URI";
        }
}

server "consultores.ca" {
        listen on * tls port 443
        root "/htdocs/consultores"
        tls {
                certificate "/etc/letsencrypt/live/consultores.ca/fullchain.pem"
                key "/etc/letsencrypt/live/consultores.ca/privkey.pem"
        }
        location "/pub/*" {
                directory auto index
        }
        location "/ENA/*" {
                root "/htdocs/ENA"
        }
        location "/ENA/pub/*" {
                directory auto index
        }
}

I tried to replicate your config how I think you meant it. Perhaps there
is a way to somehow express the two ‘directory auto index’ blocks in one
block but this should get you started.

I don’t think you actually need to handle ACME challenges in
consultores.ca/ETA/.well-known/acme-challenge, as your domain is
consultores.ca and these challenges will go to
consultores.ca/.well-known/acme-challenge instead.
Furthermore, I think you only need to handle acme-challenges over HTTP,
not over TLS.

Best regards
Bertalan


-- 
Bertalan Z. Péter <[email protected]>
PGP: FB9B 34FE 3500 3977 92AE  4809 935C 3BEB 44C1 0F89

Attachment: signature.asc
Description: PGP signature

Reply via email to