Skip to content

Commit

Permalink
added to renew-certs.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenaH84 committed Jun 15, 2024
1 parent 666a993 commit 2ddebf7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
3 changes: 1 addition & 2 deletions nginx/project.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
server {

listen 8001;
server_name docker_genie_gunicorn_nginx;

Expand All @@ -20,7 +19,7 @@ server {

server {
listen 80;
server_name app.batterymodel.com; # Replace with your domain name
server_name app.batterymodel.com;

location /.well-known/acme-challenge/ {
root /usr/share/nginx/html;
Expand Down
11 changes: 8 additions & 3 deletions nginx/renew-certs.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
#!/bin/bash

# Run Certbot to obtain or renew certificates
certbot certonly --non-interactive --agree-tos --email [email protected] --webroot -w /usr/share/nginx/html -d app.batterymodel.com
# Stop existing containers
docker compose down

# Obtain/renew SSL certificates
certbot certonly --webroot -w /usr/share/nginx/html -d app.batterymodel.com --agree-tos --email [email protected]

# Reload Nginx configuration to apply new certificates
# Start containers again
docker compose up -d

# Reload Nginx to apply new certificates
nginx -s reload

0 comments on commit 2ddebf7

Please sign in to comment.