[certbot] [nginx] Is there a way to add certificates on the "http" block?

I am trying to run two applications on my domain. I have figured out how to get a single cert for


I have this refreshing automatically. Yay.

Now, I’d like to have the following set up in nginx:

http {
   # SSL cert setup

  server {
     server_name a.domain.com;
  server {
    server_name b.domain.com;

so that I don’t have to do awkward “if” statements in my nginx configuration, serving one app or the other.

Is this possible with certbot?

Nginx supports it. Certbot’s Nginx plugin can’t automatically configure it that way.

But it’s not a problem to configure the same ssl settings in two server blocks, except for being a little redundant.

Edit: That was supposed to be “can’t”, not “can”! Our editors* (*me) regret the error.

I don’t suppose it will kick in automatically if I configure it manually and keep the “# managed by certbot” comments? :slight_smile:

Really hoping to avoid manual manipulation heh.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.