Convert v1 to v2 with EFS and on-demand tls

1. Caddy version (caddy version):

Version 2

2. How I run Caddy:

a. System environment:

Ubuntu 20.04 LTS

b. Command:

Paste command here.

c. Service/unit/compose file:

Paste full file contents here.
Make sure backticks stay on their own lines,
and the post looks nice in the preview pane.

d. My complete Caddyfile or JSON config:

Caddy Common

gzip
tls support@app.com

errors /var/log/caddy/error.log {
  rotate_size 10
  rotate_keep 10
  rotate_compress
}

log / /var/log/caddy/access.log "{combined} {hostonly} {latency_ms}" {
  rotate_size 10
  rotate_keep 10
  rotate_compress
}

Caddyfile

app.com api.app.com docs.app.com admin.app.com business.app.com {
  gzip
  root /home/user/app.com/current/public

  rewrite {
    if {path} is /
    to /app-proxy/{uri}
  }

  rewrite {
    to index.html {path} /app-proxy/{uri}
  }

  proxy /app-proxy unix:/home/user/app.com/shared/tmp/sockets/puma.sock {
    without /app-proxy
    transparent
  }
}


:443 {
  import Caddycommon
  gzip
  root /home/user/app.com/current/public

  tls {
    # on-demand
    ask https://api.app.com/path/present.json
  }

  rewrite {
    if {path} is /
    to /app-proxy/{uri}
  }

  rewrite {
    to index.html {path} /app-proxy/{uri}
  }

  proxy /app-proxy unix:/home/user/app.com/shared/tmp/sockets/puma.sock {
    without /app-proxy
    transparent
  }
}

3. The problem Iā€™m having:

I would like help converting a version 1 configuration file to version 2 without loosing functionality.
The basic setup is two servers running Caddy v2, connected with shared certificate storage on AWS efs using on-demand TLS to create domains on the fly.

4. Error messages and/or full log output:

5. What I already tried:

6. Links to relevant resources:

Any help would be appreciated.

Have you read the upgrade guide?

Yes, but unfortunately I am not super technical. Any help would be appreciated, it is on a system that is legacy.

i have just posted this as an upwork job if anyone is interested. Log In - Upwork

1 Like