all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alex Sassmannshausen <alex.sassmannshausen@gmail.com>
To: 36389@debbugs.gnu.org
Subject: bug#36389: nginx/certbot interaction doesn't work as documented
Date: Wed, 26 Jun 2019 10:31:57 +0100	[thread overview]
Message-ID: <875zos3d6a.fsf@gmail.com> (raw)
In-Reply-To: <249AC56B-BE05-4162-B65D-618490163CB0@vllmrt.net>

Hi Robert,

Robert Vollmert <rob@vllmrt.net> writes:

> I’ve tried setting up nginx with certbot on guix. Two immediate issues:
>
> - certbot extends the nginx service to serve challenge files. It appears
>   that this nginx service extension conflicts (silently) with an independently
>   configured nginx service. I.e., I had nginx previously configured, and
>   after adding certbot, my previous nginx kept running with the previous
>   configuration (even after herd restart nginx), while there was an additional
>   nginx config in the gnu store with the certbot-specific fragments. certbot
>   activation called nginx to test that fragment, but apparently never started
>   nginx (successfully?). There were no errors.
>
>   After removing the stand-alone nginx service and restarting nginx, it started
>   with the certbot configuration.

This sounds odd, and I don't recall having this issue on my servers with
nginx SSL server configuration extended with certbot service.

>
> - After this, /var/lib/certbot/renew worked successfully to register a
>   certificate, but then failed when calling the nginx deploy hook that I’d
>   copied from the guix certbot documentation, because /var/run/nginx/pid
>   doesn’t exist. That might be a bug in the nginx package, not sure. I can’t
>   find an nginx pid file anywhere, and no other errors related to it either,
>   even though the config file includes
>  pid /var/run/nginx/pid;

The pid exists on my servers running an SSL nginx server config
configuration extended with certbot.

I've found the certbot & nginx services, overall, work very well
together.  But there are a couple of gotchas in my experience:

- The certbot service includes a redirect from port 80 to 443 for all
  except .well-known location.  By itself this may cause no problems for
  you.

- If deploying on a server that hitherto has no SSL certificate you have
  a chicken and egg problem: you will want your site to be configured to
  use the letsencrypt cert directories, to serve ssl (the redirect means
  any non-ssl deployments won't work anyway), but those directories
  don't yet exist as you haven't generated certs with certbot yet.

Here's a journey that should work:
- run system configuration with just the certbot service
- use certbot to generate your initial certificates
- reconfigure with additional nginx server configuration, pointing to
  the SSL certificates created by certbot

If the above is not helpful, perhaps you could share the nginx
configuration generated when you have both certbot & your custom server
running?

Can't promise anything, but we might be able to spot what's happening.

Best wishes,

Alex

  reply	other threads:[~2019-06-26  9:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-26  8:39 bug#36389: nginx/certbot interaction doesn't work as documented Robert Vollmert
2019-06-26  9:31 ` Alex Sassmannshausen [this message]
2019-06-26 18:21 ` bug#36389: odd Robert Vollmert
2021-12-20 16:17 ` bug#36389: Nginx and certbot Andreas Enge
2021-12-20 16:46   ` Andreas Enge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875zos3d6a.fsf@gmail.com \
    --to=alex.sassmannshausen@gmail.com \
    --cc=36389@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.