{"id":26610271,"url":"https://github.com/times-z/caddy-preconfigured","last_synced_at":"2026-05-06T05:33:13.122Z","repository":{"id":158993455,"uuid":"602683914","full_name":"Times-Z/caddy-preconfigured","owner":"Times-Z","description":"Caddy 2 preconfigured docker container with tls modules for azure/ovh/cloudflare provider","archived":false,"fork":false,"pushed_at":"2025-02-12T12:51:46.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-12T13:57:50.339Z","etag":null,"topics":["caddy","caddyserver","cloudflare","config","nginx","ovh-api","reverse-proxy"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Times-Z.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-16T18:17:59.000Z","updated_at":"2025-02-12T12:51:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"828a74d0-c919-41ed-8e1b-2d6e01c3f761","html_url":"https://github.com/Times-Z/caddy-preconfigured","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Times-Z%2Fcaddy-preconfigured","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Times-Z%2Fcaddy-preconfigured/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Times-Z%2Fcaddy-preconfigured/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Times-Z%2Fcaddy-preconfigured/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Times-Z","download_url":"https://codeload.github.com/Times-Z/caddy-preconfigured/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245195943,"owners_count":20575936,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["caddy","caddyserver","cloudflare","config","nginx","ovh-api","reverse-proxy"],"created_at":"2025-03-24T01:38:27.598Z","updated_at":"2026-05-06T05:33:13.113Z","avatar_url":"https://github.com/Times-Z.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Caddy 2 \"1 min\" setup\n\n[![Build and Publish](https://github.com/Times-Z/caddy-preconfigured/actions/workflows/docker-image.yml/badge.svg)](https://github.com/Times-Z/caddy-preconfigured/actions/workflows/docker-image.yml)\n\nThis repository is docker container of [caddy](https://caddyserver.com/) including :\n- Ovh dns provider module\n- Azure dns provider module\n- Cloudflare dns provider module\n- php-fpm or reverse proxy preconfiguration\n\nThis is the fastest way to provide https protocol in your application ! 🚀✨\n\n## [Configuration](#configuration)\nThis docker image is configurable by env vars.\n\n### Available Variables\n\n#### Global Variables\n\n| Variable | Default Value | Description |\n|----------|---------------|-------------|\n| `DOMAIN` | `localhost` | Your domain name such as `foo.bar.domain` |\n| `DOMAIN_PORT` | `443` | Listening port for your domain configuration |\n| `CADDY_MODE` | `reverse-proxy` | Default snippet used for configuration. Possible values: `reverse-proxy`, `php-fpm`, `html` or `false` (to disable) |\n| `CADDY_DOMAIN_EXTRA_CONFIG` | `null` | Custom extra config for domain scope. Use the syntax `{env.XXX}` instead of `{$XXX}` for environment variables. You can use snippets defined in Caddyfile (see [Snippet section](#defined-snippet)). Example: `header x-domain-from \"{env.DOMAIN}\"` |\n| `CADDY_GLOBAL_EXTRA_CONFIG` | `null` | Custom extra global configuration. Use the syntax `{env.XXX}` instead of `{$XXX}` for environment variables. You can use snippets defined in Caddyfile (see [Snippet section](#defined-snippet)). **Tip:** To provide multiline values in docker-compose.yml, use `\\|` (not `\u003e` as it doesn't add `\\n` at line ends). Example: \u003cbr\u003e`CADDY_GLOBAL_EXTRA_CONFIG: \\|`\u003cbr\u003e\u0026nbsp;\u0026nbsp;`localhost:80 {`\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;`respond \"Hello, world!\"`\u003cbr\u003e\u0026nbsp;\u0026nbsp;`}` |\n| `TLS_PROVIDER` | `tls-ovh` | Your TLS provider. Possible values: `tls-ovh`, `tls-azure`, `tls-cloudflare` or `false` (to disable) |\n| `WHITELIST_IPS` | `0.0.0.0/0` | List of IP addresses or IP ranges to whitelist (space-separated). Returns 403 for requests not in scope. Examples: `127.0.0.1` (single IP) or `127.0.0.0/24` (IP range). Multiple values: `127.0.0.1 10.0.0.0/24` |\n\n#### Reverse Proxy Configuration\n\n| Variable | Default Value | Description |\n|----------|---------------|-------------|\n| `BACKEND_ENDPOINT` | `nginx:80` | Endpoint to which requests are forwarded, such as `http://foo.bar:8000` or `wordpress:80` |\n\n#### HTML Server Configuration\n\n| Variable | Default Value | Description |\n|----------|---------------|-------------|\n| `WEBROOT` | `/var/www/html` | Default web root for the web server |\n\n#### PHP-FPM Configuration\n\n| Variable | Default Value | Description |\n|----------|---------------|-------------|\n| `WEBROOT` | `/var/www/html` | Default web root for the web server |\n| `PHP_FASTCGI` | `php:9000` | PHP FastCGI backend address, such as `unix//run/php/php8.2-fpm.sock` (for socket) or `my-phpfpm-container:9000` (for container) |\n\n#### TLS Provider Variables\n\n##### OVH\n\n| Variable | Default Value | Description |\n|----------|---------------|-------------|\n| `OVH_ENDPOINT` | `ovh-eu` | OVH API endpoint |\n| `OVH_APPLICATION_KEY` | - | OVH application key (required) |\n| `OVH_APPLICATION_SECRET` | - | OVH application secret (required) |\n| `OVH_CONSUMER_KEY` | - | OVH consumer key (required) |\n\n##### Azure\n\n| Variable | Default Value | Description |\n|----------|---------------|-------------|\n| `AZURE_TENANT_ID` | - | Azure tenant ID (required) |\n| `AZURE_CLIENT_ID` | - | Azure client ID (required) |\n| `AZURE_CLIENT_SECRET` | - | Azure client secret (required) |\n| `AZURE_SUBSCRIPTION_ID` | - | Azure subscription ID (required) |\n| `AZURE_RESOURCE_GROUP_NAME` | - | Azure resource group name (required) |\n\n##### Cloudflare\n\n| Variable | Default Value | Description |\n|----------|---------------|-------------|\n| `CLOUDFLARE_API_TOKEN` | - | Cloudflare API token (required) |\n\n##### DuckDNS\n\n| Variable | Default Value | Description |\n|----------|---------------|-------------|\n| `DUCK_DNS_TOKEN` | - | DuckDNS token (required) |\n\n\n## [Examples](#Examples)\n\nThis is an example to provide TLS for qbittorrent web application using reverse-proxy configuration with ip range or specific ip white list\n\n```yml\nservices:\n  qbittorrent:\n    image: lscr.io/linuxserver/qbittorrent:latest\n    container_name: qbittorrent\n    environment:\n      TZ: Europe/Paris\n      WEBUI_PORT: 8080\n    networks:\n      - proxy\n\n  caddy:\n    image: ghcr.io/times-z/caddy-preconfigured/caddy:latest\n    container_name: caddy\n    ports:\n      - 80:80\n      - 443:443\n    environment:\n      DOMAIN: \"qbittorrent.timesz.fr\"\n      OVH_APPLICATION_KEY: \"my ovh application key\"\n      OVH_APPLICATION_SECRET: \"my ovh application secret\"\n      OVH_CONSUMER_KEY: \"my ovh consumer key\"\n      BACKEND_ENDPOINT: \"qbittorrent:8080\"\n      WHITELIST_IPS: 192.168.1.0/24 172.18.0.0/24 10.0.1.21\n    volumes:\n      - caddy_data:/data\n    networks:\n      - proxy\n\nnetworks:\n  proxy:\n    name: proxy\n\nvolumes:\n  caddy_data:\n```\n\nThis is an other example to provide a http server with https for my php-fpm container\n```yml\nservices:\n  application:\n    image: php:8.1.16-fpm\n    container_name: php-fpm\n    environment:\n      TZ: Europe/Paris\n    volumes:\n      - application_root:/var/www/html:rw\n    networks:\n      - caddy\n  caddy:\n    image: ghcr.io/times-z/caddy-preconfigured/caddy:latest\n    container_name: caddy\n    ports:\n      - 80:80\n      - 443:443\n    environment:\n      DOMAIN: \"application.timesz.fr\"\n      CADDY_MODE: \"php-fpm\"\n      OVH_APPLICATION_KEY: \"my ovh application key\"\n      OVH_APPLICATION_SECRET: \"my ovh application secret\"\n      OVH_CONSUMER_KEY: \"my ovh consumer key\"\n      PHP_FASTCGI: \"application:9000\"\n    volumes:\n      - caddy_data:/data:rw\n      - application_root:/var/www/html:ro\n    networks:\n      - caddy\n\nnetworks:\n  caddy:\n    name: caddy\n\nvolumes:\n  caddy_data:\n  application_root:\n```\n\n## [Defined snippets](#defined-snippet)\n\n- `tls-ovh` : use [caddy-dns/ovh](https://github.com/caddy-dns/ovh) plugin to provide TLS\n- `tls-cloudflare` : use [caddy-dns/cloudflare](https://github.com/caddy-dns/cloudflare) plugin to provide TLS\n- `tls-azure` : use [caddy-dns/azure](https://github.com/caddy-dns/azure) plugin to provide TLS\n- `reverse-proxy` : use [reverse_proxy](https://caddyserver.com/docs/caddyfile/directives/reverse_proxy) directive to provide a simple reverse proxy to a backend wich defined with `BACKEND_ENDPOINT` environnement variable (see [configuration](#configuration))\n- `php-fpm` : provide a default configuration for php (see [configuration](#configuration))\n- `html` : simple html/css/js server\n- `whitelist-ip` : use directive not remote_ip to block all request that is not whitelisted client. First param is trusted IPs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimes-z%2Fcaddy-preconfigured","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimes-z%2Fcaddy-preconfigured","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimes-z%2Fcaddy-preconfigured/lists"}