suchorski / keycloak-docker-compose

A Docker for a Keycloak server using MariaDB, Nginx, Certbot and Mail
MIT License
23 stars 8 forks source link

Reload nginx after certifcate renewal #3

Closed hikufi-dev closed 1 month ago

hikufi-dev commented 1 month ago

Hi @suchorski

In the installation instructions on the 6th item why not reload nginx so it uses the new certificate? I'm pretty sure you have to reload, otherwise nginx won't use the new certificate. You haven't had any issues?

  1. Clone this repository on your local computer;
  2. Create a .env and configure it according to your needs (see below);
  3. Run docker compose -f docker-compose-ssl.yml up -d to generate the SSL certificates;
  4. Run docker compose -f docker-compose-ssl.yml down to stop the container;
  5. Run docker compose up -d to start the stack;
  6. Configure the crontab to renew the SSL certificates automatically each 12 hours with the command: docker compose -f /path/to/docker-compose.yml up certbot && docker compose -f /path/to/docker-compose.yml exec nginx nginx -s reload
suchorski commented 1 month ago

Hi @suchorski

In the installation instructions on the 6th item why not reload nginx so it uses the new certificate? I'm pretty sure you have to reload, otherwise nginx won't use the new certificate. You haven't had any issues?

  1. Clone this repository on your local computer;

  2. Create a .env and configure it according to your needs (see below);

  3. Run docker compose -f docker-compose-ssl.yml up -d to generate the SSL certificates;

  4. Run docker compose -f docker-compose-ssl.yml down to stop the container;

  5. Run docker compose up -d to start the stack;

  6. Configure the crontab to renew the SSL certificates automatically each 12 hours with the command: docker compose -f /path/to/docker-compose.yml up certbot && docker compose -f /path/to/docker-compose.yml exec nginx nginx -s reload

You are right. Do you have any suggestion? I will put a second crontab to reload nginx

hikufi-dev commented 1 month ago

@suchorski having compose -f /path/to/docker-compose.yml up certbot && docker compose -f /path/to/docker-compose.yml exec nginx nginx -s reload in the crontab as just one entry should suffice.

suchorski commented 1 month ago

Will update that. Thanks