Can't access project absolute url from inside Django Docker instance

余生颓废 提交于 2019-12-11 05:20:06

问题


I have a project started with Cookiecutter Django and I'm currently adding WeasyPrint to serve some views as PDF files. This is working fine on development. Cookiecutter Django is using Caddy as the HTTP server. I'm having errors on production due I can't access to files through its absolute URL from inside the Django docker instance.

From inside the Django docker instance, this does not work:

$ curl https://myowndomain.com
curl: (7) Failed to connect to myowndomain.com port 443: Connection timed out

But this does:

$ curl https://www.google.com

From outside the Django docker instance both curl commands are working OK.

Is there something I need to set? Am I missing something?


回答1:


probably in development it use http on port 80 and in production it use https on port 443. In the docker-compose.yml or when you invoke docker do you expose port 443?



来源:https://stackoverflow.com/questions/51102841/cant-access-project-absolute-url-from-inside-django-docker-instance

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!