Create directory for certbot / http based root
This commit is contained in:
parent
dddcd602f3
commit
43672378fb
3 changed files with 8 additions and 6 deletions
|
@ -1,6 +1,6 @@
|
|||
FROM nginx:1.21.4-alpine
|
||||
|
||||
RUN mkdir -p /nginx
|
||||
RUN mkdir -p /nginx /www_http
|
||||
COPY nginx-http-redir.conf /nginx/default.conf
|
||||
|
||||
# For renewing the certificates
|
||||
|
|
|
@ -3,10 +3,10 @@ server {
|
|||
listen [::]:80;
|
||||
|
||||
server_name _;
|
||||
root /var/www/html/;
|
||||
root /www_http;
|
||||
|
||||
location /.well-known/acme-challenge/ {
|
||||
root /var/www/html;
|
||||
root /www_http;
|
||||
}
|
||||
|
||||
# Everything else -> ssl
|
||||
|
|
|
@ -3,9 +3,8 @@
|
|||
if [ "$NO_NGINX" ]; then
|
||||
/usr/bin/certbot renew --standalone
|
||||
else
|
||||
/usr/bin/certbot renew --webroot --webroot-path /var/www/html
|
||||
# Reload nginx
|
||||
pkill -1 nginx
|
||||
/usr/bin/certbot renew --webroot --webroot-path /www_http
|
||||
|
||||
fi
|
||||
|
||||
# Correct permissions if not told otherwise
|
||||
|
@ -14,4 +13,7 @@ if [ -z "$LEAVE_PERMISSIONS_AS_IS" ]; then
|
|||
find /etc/letsencrypt -type f -exec chmod 0644 {} \;
|
||||
fi
|
||||
|
||||
# Reload certs
|
||||
pkill -1 nginx
|
||||
|
||||
echo "Last renew: $(date)" > /tmp/last_renew
|
||||
|
|
Loading…
Reference in a new issue