How to add reverse proxies via API and not using Caddyfile?

1. Caddy version (caddy version):

  • v2.3.0

2. How I run Caddy:

  • Using Digitalocean droplet.
  • Installed Go v1.16.3
  • Installed XCaddy
  • Installed gamalan/caddy-tlsredis

a. System environment:

  • Running it on Ubuntu 18.04

d. My complete JSON config:

{
  "admin": {
    "listen": "0.0.0.0:2019"
  },
  "storage": {
    "aes_key": "key-123",
    "host": "redis-host",
    "key_prefix": "caddytls",
    "module": "redis",
    "password": "pass",
    "port": "25061",
    "timeout": 5,
    "tls_enabled": true,
    "tls_insecure": true,
    "value_prefix": "caddy-storage-redis"
  }
}

3. The problem I’m having:

I can not understand how to add reverse proxies via API?
It works with Caddyfile but I need to add reverse proxies via API.

Best place to start is to write the config you want with the Caddyfile, then adapt it to JSON with the caddy adapt --pretty command.

This topic was automatically closed after 30 days. New replies are no longer allowed.