I am deploying a django app using the dockerized cookiecutter-django template. The docker configuration for traefik and all the configuration files are available at the github repository: GitHub - pydanny/cookiecutter-django: Cookiecutter Django is a framework for jumpstarting production-ready Django projects quickly.
I am using DigitalOcean as host and porkbun as registrar, with an A DNS record mapping the root domain to the DigitalOcean droplet's IP. However, when I go to the application's domain in the browser, I encounter a security warning with the following error:
Subject: TRAEFIK DEFAULT CERT
Issuer: TRAEFIK DEFAULT CERT
Expires on: Jul 19, 2022
Current date: Jul 19, 2021
According to the cookiecutter-django documentation, HTTPS should be on by default (Deployment with Docker — Cookiecutter Django 2021.28.2 documentation). I wonder whether this is related to the fact that porkbun provides its own SSL certificate which might not be detected by traefik.
The porkbun website shows the following information regarding the SSL certificate for my domain:
Created On: Fri, 16 Jul 2021 14:14
Expires On: Thu, 14 Oct 2021 14:14
Finally, the logs of the traefik docker container show the following:
traefik_1 | time="2021-07-19T08:41:29Z" level=error msg="Unable to obtain ACME certificate for domains \"my-domain.io,www.my-domain.io\": unable to generate a certificate for the domains [my-domain.io www.my-domain.io]: error: one or more domains had a problem:\n[my-domain.io] acme: error: 403 :: urn:ietf:params:acme:error:unauthorized :: Invalid response from https://my-domain.io/.well-known/acme-challenge/some-random-token [220.127.116.11]: \"<html>\\r\\n<head><title>404 Not Found</title></head>\\r\\n<body>\\r\\n<center><h1>404 Not Found</h1></center>\\r\\n<hr><center>openresty</cente\", url: \n[www.my-domain.io] acme: error: 403 :: urn:ietf:params:acme:error:unauthorized :: Invalid response from https://my-domain.io/ [18.104.22.168]: \"\\n<!DOCTYPE html>\\n<html lang=\\\"en\\\">\\n <head>\\n\\n<!-- Global site tag (gtag.js) - Google Analytics -->\\n<script async src=\\\"https://www\", url: \n" rule="Host(my-domain.io
) || Host(www.my-domain.io
)" providerName=letsencrypt.acme routerName=web-secure-router@file
If I tell my browser to make an exception and ignore the security warning, the web application functions correctly. What am I doing wrong?
Thank you in advance. Best,