我正在尝试使用 linux 盒子(运行 ubuntu 18.04)和 nginx、gunincorn、letsencrypt 和 docker 来提供 python-django web 应用程序。在学习了许多在线教程之后,我按照本教程http://pawamoy.github.io/2018/02/01/docker-compose-django-postgres-nginx 成功通过端口 80 通过 http 提供了应用程序服务。 html。
然而,我现在真的很难通过端口 443 通过 https 进行部署。我想也许我不理解基本的 docker 概念。我运行时遇到的错误sudo docker-compose up如下。
NGINX 错误:
nginx_1 | nginx: [emerg] open() "/etc/letsencrypt/options-ssl-nginx.conf" failed (2: No such file or directory) in /etc/nginx/conf.d/local_ssl.conf:28
我相信这是因为我没有链接 docker-compose.yml 文件中的 options-ssl-nginx.conf 文件,也许是通过卷?我不知道这是否正确。我的 docker-compose.yml 文件和 nginx.conf 文件的相关部分如下:
docker-compose.yml:
version: '3'
services:
# database containers
database1:
...
# web container
djangoapp:
...
# reverse proxy container (nginx)
nginx:
image: …Run Code Online (Sandbox Code Playgroud)