Ionică Bizău
Ionică Bizău

Reputation: 113445

Generate Let's Encrypt certificates and set the public pathname

I'm following the guide to generate the certificates and it works well: inside of the public directory (webroot) it creates a folder called .well-known containing some stuff in it.

Then it tries to make a request to my.domain.com/.well-known/..., but that ends with a 404 due my application architecture.

In my app, the stuff in the public directory is accessible under a specific path: my.domain.com/!/foo/public/.well-known/...

How can I tell Let's Encrypt to make the request to that url?

Currently it ends with this error:

Requesting root privileges to run certbot...
  /home/ubuntu/.local/share/letsencrypt/bin/letsencrypt certonly
    --webroot -w ../preview-app-packed/preview-app/public/ -d preview.mydomain.org
Failed authorization procedure.
preview.mydomain.org (http-01): urn:acme:error:unauthorized :: Theclient lacks
sufficient authorization :: Invalid response from http://preview.
mydomain.org/.well-known/acme-challenge/4FH...fsM: "<!DOCTYPE html>

Upvotes: 0

Views: 81

Answers (1)

Tom
Tom

Reputation: 4846

TL;DR you can't

The fact that you control /.well-known is used to prove your ownership of the domain. That's why you can't change it.

If you can't change your application architecture, you can use a different kind of validation, like a DNS one with another ACME client.

Upvotes: 1

Related Questions