0

I'm looking for the correct root to use for Jetbrains Hub, UpSource & YouTrack with LetsEncrypt. I have all three of these located in their own folder in /opt/

With certbot, I am using the following command to generate a certificate:

certbot certonly --webroot -w <root> -d hub.example.com

I assumed the root would be /opt/hub/apps/hub/web yet I get an error when certbot is trying to locate the certificate in the .well-known folder indicating the root is incorrect.

I'd rather not create a "fake" root in /var/www/jetbrains and keep everything in their own folder if possible.

(I could not use the tags jetbrains-hub youtrack & upsource as they do not exist and I do not have enough reputation, if anyone would be so kind, thank you).

Gordon
  • 155
  • 9
Yates
  • 111
  • 3
  • Are you not using a web server with these applications?! – Michael Hampton Dec 13 '16 at 18:48
  • @MichaelHampton I have setup all three with a proxy in nginx in according with the Jetbrains documentation. Example: https://www.jetbrains.com/help/upsource/3.5/proxy-configuration.html – Yates Dec 13 '16 at 18:52
  • In that case you can just add an appropriate `location` in the nginx configuration. – Michael Hampton Dec 13 '16 at 19:06
  • @MichaelHampton sadly this would require me to push a request for the `.well-known` folder to another root if I'm not mistaken. – Yates Dec 13 '16 at 19:51

1 Answers1

0

You say you'd rather not create a "fake" root, but it vastly simplifies management and it works across everything, regardless of application or domain, so I'm going to ignore that request for this answer.

Include

location /.well-known/acme-challenge {
    alias /var/www/letsencrypt;
    index index.html;
    location = /.well-known/acme-challenge {
    try_files $uri $uri/ =444;
}

in the server block for each application and tell certbot to use /var/www/letsencrypt as the webroot. I have this in a template I include in dozens of server{} blocks for various domains and applications. You can leave off the index if you want, but I like to put "Go away." index.html files everywhere just to make sure auto-indexing doesn't happen.

Gordon
  • 155
  • 9