# Trouble getting ACME cert

**URL:** <https://community.traefik.io/t/trouble-getting-acme-cert/19539>\
**Category:** Traefik v2\
**Tags:** letsencrypt-acme, docker\
**Created:** [August 17, 2023, 10:43pm UTC](https://community.traefik.io/t/trouble-getting-acme-cert/19539 "2023-08-17T22:43:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jantje](https://avatars.discourse-cdn.com/v4/letter/j/73ab20/32.png) [@jantje](https://community.traefik.io/u/jantje)\
**Post date:** [August 17, 2023, 10:43pm UTC](https://community.traefik.io/t/trouble-getting-acme-cert/19539/1 "2023-08-17T22:43:39Z")

</div>

I installed a Django app on AWS EC2 using Docker. My confguration follows the Django cookiecutter template. But when I start my containers, I see this error in the logs:

```auto
"Unable to obtain ACME certificate for domains \"example.com,www.example.com\": unable to generate a certificate for the domains [example.com www.example.com]: acme: error: 400 :: POST :: https://acme-v02.api.letsencrypt.org/acme/new-order :: urn:ietf:params:acme:error:rejectedIdentifier :: Error creating new order :: Cannot issue for \"example.com\":

```

So it does not seem to pick up my domain name at all, but thinks my domain is [example.com](http://example.com), and not the domain specified in the yml file.

This is my traefik.yml file:

```auto
log:
  level: INFO

entryPoints:
  web:
    # http
    address: ':80'
    http:
      # https://docs.traefik.io/routing/entrypoints/#entrypoint
      redirections:
        entryPoint:
          to: web-secure

  web-secure:
    # https
    address: ':443'

  flower:
    address: ':5555'

certificatesResolvers:
  letsencrypt:
    # https://docs.traefik.io/master/https/acme/#lets-encrypt
    acme:
      email: 'jang@***.com'
      storage: /etc/traefik/acme/acme.json
      # https://docs.traefik.io/master/https/acme/#httpchallenge
      httpChallenge:
        entryPoint: web

http:
  routers:
    web-secure-router:
      rule: 'Host(`store.MYDOMAIN.com`)'
      entryPoints:
        - web-secure
      middlewares:
        - csrf
      service: django
      tls:
        # https://docs.traefik.io/master/routing/routers/#certresolver
        certResolver: letsencrypt

    flower-secure-router:
      rule: 'Host(`store.MYDOMAIN.com`)'
      entryPoints:
        - flower
      service: flower
      tls:
        # https://docs.traefik.io/master/routing/routers/#certresolver
        certResolver: letsencrypt

  middlewares:
    csrf:
      # https://docs.traefik.io/master/middlewares/headers/#hostsproxyheaders
      # https://docs.djangoproject.com/en/dev/ref/csrf/#ajax
      headers:
        hostsProxyHeaders: ['X-CSRFToken']

  services:
    django:
      loadBalancer:
        servers:
          - url: http://django:5000

    flower:
      loadBalancer:
        servers:
          - url: http://flower:5555

providers:
  # https://docs.traefik.io/master/providers/file/
  file:
    filename: /etc/traefik/traefik.yml
    watch: true

```

Any help / insight is appreciated

---

<div class="post-metadata">

**Author:** ![jantje](https://avatars.discourse-cdn.com/v4/letter/j/73ab20/32.png) [@jantje](https://community.traefik.io/u/jantje)\
**Post date:** [August 18, 2023, 7:19pm UTC](https://community.traefik.io/t/trouble-getting-acme-cert/19539/2 "2023-08-18T19:19:02Z")

</div>

My fault entirely. Was not using the updated image

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [August 18, 2023, 8:10pm UTC](https://community.traefik.io/t/trouble-getting-acme-cert/19539/3 "2023-08-18T20:10:13Z")

</div>

You should probably use separate files for static (entrypoints, providers, certificatesResolvers) and dynamic (routers, services) config.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/containo/original/2X/b/bd81ebdb578656e76e56ff3cc3eed021d3ba132d.png) [@system](https://community.traefik.io/u/system)\
**Post date:** [August 21, 2023, 8:10pm UTC](https://community.traefik.io/t/trouble-getting-acme-cert/19539/4 "2023-08-21T20:10:13Z")

</div>

Closed on August 21, 2023, 8:10pm UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
