问题
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