Skip to content

Commit 418ed8e

Browse files
committed
Add SSL renewal script and update server configuration for HTTPS redirection
1 parent 13f6f7e commit 418ed8e

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

deployment/scripts/renew-ssl.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
3+
4+
# Run daily on crontab e.g.
5+
# Your cron job will be run at: (5 times displayed)
6+
#
7+
# 2021-11-08 11:10:00 UTC
8+
# 2021-11-09 11:10:00 UTC
9+
# 2021-11-10 11:10:00 UTC
10+
# 2021-11-11 11:10:00 UTC
11+
# 2021-11-12 11:10:00 UTC
12+
# ...etc
13+
14+
#25 11 * * * /bin/bash /home/web/QGIS-Certification-Website/deployment/scripts/renew_ssl.sh > /tmp/ssl-renewal-logs.txt
15+
16+
17+
docker compose -f /home/web/QGIS-Certification-Website/deployment/docker-compose.yml -f /home/web/QGIS-Certification-Website/deployment/docker-compose.override.yml run certbot renew

deployment/sites-enabled/prod-ssl.conf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ server {
2222
# the port your site will be served on
2323
listen 80;
2424
# the domain name it will serve for
25-
server_name plugins.qgis.org;
26-
27-
# Redirect all HTTP traffic to HTTPS
28-
return 301 https://$server_name$request_uri;
25+
server_name certification.qgis.org;
2926

3027
charset utf-8;
3128

@@ -96,6 +93,9 @@ server {
9693
return 403;
9794
}
9895

96+
# Redirect all HTTP traffic to HTTPS
97+
return 301 https://$server_name$request_uri;
98+
9999
# Redirect planet and hub resources to the new location
100100
include redirections.conf;
101101
}
@@ -230,4 +230,4 @@ server {
230230
}
231231

232232
root /var/www/webroot;
233-
}
233+
}

0 commit comments

Comments
 (0)