Hello everyone, I have problems generating cerbot certificate. I figure unauthorized. I attach nginx configuration and docker compose.
I am using these instructions but I still get that error:
docker-compose:
version: '3'
services:
#PHP App
app:
image: prueba/tta-php-nginx:latest
container_name: php_app
restart: unless-stopped
working_dir: /var/www/html
volumes:
- ../:/var/www/html
- ./config/uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
networks:
- app_net
#Nginx Service frontend
nginx:
image: nginx:1.14.0
container_name: nginx
restart: unless-stopped
ports:
- "80:80"
- "8083:8083"
- "443:443"
volumes:
- ../:/var/www/html
- ./config/conf.d/:/etc/nginx/conf.d/
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
networks:
- app_net
certbot:
image: certbot/certbot:v0.36.0
restart: always
volumes:
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
networks:
app_net:
driver: bridge
Nginx setting
server {
listen 80;
server_name v2.transatuauto.cl
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
# Laravel web root directory
# root /var/www/html/tta-qa/api/web;
root /var/www/html/front;
# index index.php index.html;
client_max_body_size 512M;
error_page 403 /403.html;
error_page 404 /404.html;
error_page 502 503 504 /50x.html;
location ~ "^/\d{2}[\dx]\.html$" {
internal;
root "/hosting/apps/transatuauto.cl/document_errors";
}
location / {
# try_files $uri $uri/ /index.php?$args;
try_files $uri $uri/ /index.html;
}
# location /.well-known/acme-challenge/ {
# allow all;
# root /var/www/certbot;
# }
location /vstats {
root /hosting/app/transatuauto.cl/stats;
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass app:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
client_max_body_size 256M;
}
}