Я пытаюсь запустить мой Nginx с HTTPS.
Проблема появляется при загрузке этой строки конфигурации:
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
I есть ошибка nginx: [crit] pread() "/etc/letsencrypt/options-ssl-nginx.conf" failed (21: Is a directory)
.
Мой docker файл составления:
version: '2.3'
services:
db:
extends:
service: db
file: db_only.yml
env_file:
- envs/testing.env
backend:
build: ../backend
env_file:
- envs/testing.env
depends_on:
- db
ports:
- "8000:8000"
command: bash -c "python manage.py migrate && daphne -b 0.0.0.0 -p 8000 backend.asgi:application"
volumes:
- ../backend:/code
frontend:
extends:
service: frontend
file: local.yml
nginx:
image: nginx:latest
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- ../backend/static:/backend_static/
- ../backend/media:/media/
- ../frontend/build/static:/static/
- /etc/letsencrypt/:/etc/letsencrypt/
- ./nginx/testing.conf:/etc/nginx/conf.d/domain.conf
depends_on:
- backend
- frontend
Мой Nginx config:
client_max_body_size 100M;
upstream back {
server backend:8000;
}
upstream front {
server frontend;
}
server {
listen 80;
server_name domain;
# redirects both www and non-www to https
return 301 https://$host$request_uri;
}
server {
listen 443 ssl; # managed by Certbot
server_name domain;
ssl_certificate /etc/letsencrypt/live/domain/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/domain/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
gzip on;
location /static/ {
autoindex on;
alias /static/;
}
location /backend_static/ {
autoindex on;
alias /backend_static/;
}
location /media/ {
autoindex on;
alias /media/;
}
location /api/ {
proxy_set_header Host $host;
proxy_pass https://back/api/;
}
location /admin/ {
proxy_set_header Host $host;
proxy_pass https://back/admin/;
}
location / {
proxy_set_header Host $host;
proxy_pass https://front;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
Не могли бы вы сказать мне, что смысл здесь? Спасибо.