File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ RUN apk update && apk upgrade && \
88ENV WEB_ROOT_PATH=/var/www/certbot
99
1010# Copiar las configuraciones de nginx
11- COPY ./nginx/conf /etc/nginx/conf.d
11+ COPY ./nginx /etc/nginx
1212
1313EXPOSE 80
1414
Original file line number Diff line number Diff line change 11server {
22 listen 80 ;
33 listen [::]:80 ;
4-
5- server_name DOMAIN; # Setted by start.sh
4+
5+ server_name DOMAIN; # Set by start.sh
66 server_tokens off;
77
8+ # Disable access log to reduce disk I/O
9+ access_log off;
10+
811 location / {
9- return 200 'gangnam style!';
1012 add_header Content-Type text/plain;
13+ return 200 'gangnam style!' ;
1114 }
12-
15+
1316 location /.well-known/acme-challenge/ {
1417 root /var/www/certbot;
18+ try_files $uri =404 ;
1519 }
1620}
Original file line number Diff line number Diff line change 2121if [ ! -d " ${WEB_ROOT_PATH} " ]; then
2222 mkdir -p " ${WEB_ROOT_PATH} "
2323fi
24- sudo systemctl enable nginx
25- sudo systemctl start nginx
24+
25+ # Start Nginx service
26+ nginx
2627
2728# Launch challenge for domain, Nginx must be running with Certbot configuration to resolve
2829certbot certonly -n --webroot --webroot-path ${WEB_ROOT_PATH} -d ${DOMAIN} --agree-tos --email ${EMAIL}
2930
31+ # Stop Nginx service
32+ nginx -s stop
33+
3034if [ -f /etc/letsencrypt/live/${DOMAIN} /privkey.pem ] && [ -f /etc/letsencrypt/live/${DOMAIN} /cert.pem ]; then
3135
3236 # Create PFX file from letsencrypt certificates resolved by Certbot, output on desired path that should be mapped with Docker volume
You can’t perform that action at this time.
0 commit comments