caddy | extensible multi-platform HTTP | Proxy library

 by   caddyserver Go Version: v2.7.0-beta.1 License: Apache-2.0

kandi X-RAY | caddy Summary

kandi X-RAY | caddy Summary

caddy is a Go library typically used in Networking, Proxy, Nginx applications. caddy has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

Caddy is an extensible server platform that uses TLS by default. Releases · Documentation · Get Help.

            kandi-support Support

              caddy has a medium active ecosystem.
              It has 47723 star(s) with 3661 fork(s). There are 818 watchers for this library.
              There were 3 major release(s) in the last 12 months.
              There are 68 open issues and 3356 have been closed. On average issues are closed in 114 days. There are 14 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of caddy is v2.7.0-beta.1

            kandi-Quality Quality

              caddy has 0 bugs and 0 code smells.

            kandi-Security Security

              caddy has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              caddy code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              caddy is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              caddy releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              It has 34470 lines of code, 1359 functions and 196 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of caddy
            Get all kandi verified functions for this library.

            caddy Key Features

            No Key Features are available at this moment for caddy.

            caddy Examples and Code Snippets

            No Code Snippets are available at this moment for caddy.

            Community Discussions


            Error: Package: caddy-2.4.6-1.el9.x86_64 ( Requires:
            Asked 2022-Mar-25 at 19:39

            Am trying to get ssl working on my ec2 instance, but sudo yum caddy install tells me i need to have Requires: which by the way i cant find a way to install it on linux ec2 server



            Answered 2022-Mar-25 at 19:39

            I had the same issue, but was able to successfully install it by building it from source:

            Make sure you have Golang installed first, that's really easy



            Run commands in new terminals, then kill later
            Asked 2022-Mar-18 at 22:23

            I have a start.bat similar to the following:



            Answered 2022-Mar-18 at 22:23

            A PowerShell solution - which is acceptable as both implied by this question's tagging and as explicitly stated by icanfathom (the OP) in a comment ("No, PS would be fine") - using the Start-Process and Stop-Process cmdlets:



            How to persist users' uploads in a sulu application deployed with docker?
            Asked 2022-Mar-17 at 17:45

            I set up the symfony-docker configuration in a sulu application. Everything works fine in development thanks to the bind mount of the app root directory. But in production, the media files uploaded by the user are not persisted when containers are restarted.

            I tried adding a volume like that, in docker-compose.yml (in the php service or in the caddy service):



            Answered 2022-Mar-17 at 17:45

            Thumbnails are not generated on upload they are generated the first time you request them. This saves a lot of space as not every image is needed in every size.

            An example docker setup for development only can be found here:


            In a normal linux setup you need to make sure that your webserver user / php fpm user is allowed to access the public/uploads directory this is done via:



            Run Mercure on production : 404 no found
            Asked 2022-Feb-21 at 15:19

            I am contacting you because I can't get mercure to work in production.

            The binary prebuild runs fine, but when I try to connect to the hub, I get a 404 no found.

            Here is the command I run :



            Answered 2022-Feb-20 at 11:26

            That is my apache settings. Maybe help to you.

            open nano /etc/apache2/sites-available/



            Symfony Mercure "Failed to send an update"
            Asked 2022-Feb-14 at 15:18

            I am having an issue sending updates to the Caddy-based Mercure Hub with both the Symfony Mercure\HubInterface and the "pure" PHP example.

            When attempting to publish an update (following the official Symfony/Mercure tutorial), I get the error "Failed to send an update", with the TransportException:

            "SSL certificate problem: unable to get local issuer certificate for "https://localhost/.well-known/mercure".

            When trying to publish with the "pure" PHP example:

            I get the error:

            "Warning: file_get_contents(https://localhost/.well-known/mercure): Failed to open stream: operation failed in /"path"/test.php on line 13"

            Everything works when I run the CURL example ( in Terminal:



            Answered 2022-Feb-14 at 15:18

            try add in framework.yaml



            self-hosted posthog has been down right after I rebooted my vps
            Asked 2022-Feb-07 at 09:08


            To reproduce the issue is very simple with a few steps:

            1. Install it on your Ubuntu server by running the following command:

            /bin/bash -c "$(curl -fsSL"

            1. During the auto installation process, you will be prompted to enter the domain for your Posthog site, so enter one and wait for the process to finish.

            2. Visit the domain you entered and it is accessbile.

            3. Now reboot your VPS and visit the domain again it is down forever. Not accessbile even if you use your vps ip address.

            I've tried this auto-installation and reboot thing three times on the same vps and ended up with the same result. I've also tried it on another vps by a new hosting provider, yet still the same issue. Fresh installation and the site will be down right after your reboot your vps!

            The following is the error log I got from the Caddy container, which is generated after the vps reboot:

            {"level":"error","ts":1642534398.9394724,"logger":"http.log.error","msg":"dial tcp connect: connection refused","request":{"remote_addr":"","proto":"HTTP/2.0","method":"GET","host":"","uri":"/preflight","headers":{"Sec-Ch-Ua":["" Not A;Brand";v="99", "Chromium";v="96", "Google Chrome";v="96""],"User-Agent":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36"],"Sec-Fetch-Site":["cross-site"],"Accept-Language":["en-US,en;q=0.9"],"Accept-Encoding":["gzip, deflate, br"],"Cookie":["phtoolbar=yes; csrftoken=gsVfpdF56rbYgQQdwywH45zi83i386oe5KZZef3mIE00bumaQCG3i4OM35bdJIxQ; ph_sTMFPsFhdP1Ssg_posthog=%7B%22distinct_id%22%3A%22FpLgrw74q9qcclLSJ1bOrzsiPJmZtHdKswxemTFy9LG%22%7D"],"Cache-Control":["max-age=0"],"Sec-Ch-Ua-Mobile":["?0"],"Upgrade-Insecure-Requests":["1"],"Sec-Fetch-Dest":["document"],"Sec-Ch-Ua-Platform":[""macOS""],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9"],"Sec-Fetch-Mode":["navigate"],"Sec-Fetch-User":["?1"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","proto_mutual":true,"server_name":""}},"duration":0.008754516,"status":502,"err_id":"gicbjv2m4","err_trace":"reverseproxy.statusError (reverseproxy.go:886)"} {"level":"error","ts":1642534401.5881941,"logger":"http.log.error","msg":"dial tcp connect: connection refused","request":{"remote_addr":"","proto":"HTTP/2.0","method":"GET","host":"","uri":"/preflight","headers":{"Cache-Control":["max-age=0"],"Sec-Ch-Ua-Mobile":["?0"],"Sec-Ch-Ua-Platform":[""macOS""],"Sec-Fetch-User":["?1"],"User-Agent":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36"],"Sec-Ch-Ua":["" Not A;Brand";v="99", "Chromium";v="96", "Google Chrome";v="96""],"Sec-Fetch-Mode":["navigate"],"Accept-Encoding":["gzip, deflate, br"],"Upgrade-Insecure-Requests":["1"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9"],"Sec-Fetch-Site":["cross-site"],"Sec-Fetch-Dest":["document"],"Accept-Language":["en-US,en;q=0.9"],"Cookie":["phtoolbar=yes; csrftoken=gsVfpdF56rbYgQQdwywH45zi83i386oe5KZZef3mIE00bumaQCG3i4OM35bdJIxQ; ph_sTMFPsFhdP1Ssg_posthog=%7B%22distinct_id%22%3A%22FpLgrw74q9qcclLSJ1bOrzsiPJmZtHdKswxemTFy9LG%22%7D"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","proto_mutual":true,"server_name":""}},"duration":0.001907749,"status":502,"err_id":"27e15xwsj","err_trace":"reverseproxy.statusError (reverseproxy.go:886)"}

            By the way, this is their documentaion page FYI:

            Original question:

            I've installed Posthog with their so-called hobby installation script on my vps and at first it was working fine. But right after I rebooted ubuntu and visited my self-hosted posthog site again, it would not load and just showed a blank page. It seems that something went wrong after I rebooted my vps. I've checked all the services required by Posthog with the command docker ps, and everything is up and running(check the screenshot attached).

            I've been trying to figure it out for 4 days yet with no luck. I am new to docker and kubernetes so I do not know what causes the problem and what I should do. Please shed some light on this and help me :(



            Answered 2022-Feb-07 at 09:08

            First things first, this is a docker-compose stack, not Kubernetes. If you take a look at the script you execute, you can see that it's downlowading docker compose and then uses it to start up your stack. As such, executing docker-compose stop && docker-compose start after your rebooted should fix this.

            The "problem" here is the docker compose yaml that is used for the hobby project, which includes the following:



            Serving Symfony and Wordpress applications from Caddy, located on different roots?
            Asked 2022-Feb-06 at 13:44

            I need to serve two different sites at the same time with Caddy:

            On the root path, the site is handled by a Symfony application. But on /blog, there is Wordpress application.

            And while / is located on /var/www/app, /blog is actually served from a different root: /var/www/blog.

            I've tried with this, which almost works:



            Answered 2022-Feb-06 at 13:44

            The proper configuration would be achieved like this:



            Generic domain part with fixed subdomain using Caddy and auto SSL?
            Asked 2022-Jan-28 at 13:06

            I'd like to setup a Caddy server where the subdomain is static but the domain part is "wildcard", such as "api.*"

            From my understanding of Caddy, the wildcard is possible for one part of the full domain (* matches but not

            Moreover, this configuration would automatically create a SSL certificates (which Caddy does in general, but I'm not sure here) for any new DNS entry that points to my server with a domain starting with "api.*".

            The "*" here would be the domain directly, not any subdomain (it would work for, but not for

            Is this something possible using a simple Caddy command (such as api.* { ... }, which I tried without luck), or does it need a more complex implementation?

            Thank you for your help!



            Answered 2022-Jan-28 at 13:06

            I found a working solution with the help of the Caddy Community.

            Here's the code :



            Unable to connect to port 53589 on EC2 instance using Docker and Caddy server
            Asked 2021-Dec-28 at 13:35

            What I'm trying to do

            Host a Taskwarrior Server on an AWS EC2 instance, and connect to it via a subdomain (e.g.

            Taskwarrior server operates on port 53589.

            Tech involved

            • AWS EC2: the server (Ubuntu)
            • Caddy Server: for creating a reverse proxy for each app on the EC2 instance
            • Docker (docker-compose): for launching apps, including the Caddy Server and the Taskwarrior server
            • Cloudflare: DNS hosting and SSL certificates

            How I've tried to do this

            I have:

            • allowed incoming connections for ports 22, 80, 443 and 53589 in the instance's security policy
            • given the EC2 instance an elastic IP
            • setup the DNS records ( is CNAME'd to, has an A record pointing to the elastic IP)
            • used Caddy server to setup a reverse proxy on port 53589 for
            • setup the Taskwarrior server as per instructions (i.e. certificates created; user and organisation created; taskrc file updated with cert, auth and server info; etc)

            Config files




            Answered 2021-Dec-28 at 13:35

            If you are attempting to proxy HTTPS traffic on Cloudflare on a port not on the standard list, you will need to follow one of these options:

            1. Set it up as a Cloudflare HTTPS Spectrum app on the required port 53589
            2. Set up the record in the Cloudflare DNS tab as Grey cloud (in other words, it will only perform the DNS resolution - meaning you will need to manage the certificates on your side)
            3. Change your service so that it listens on one of the standard HTTPS ports listed in the documentation in point (1)



            Is there a way to refer to nested variable in Terraform script?
            Asked 2021-Dec-28 at 03:34

            I have a terraform script, which tries to refer to the attribute in the same resource. I need to pass "azurerm_container_group.aci_caddy.fqdn" to the container instance inside the container group.



            Answered 2021-Dec-27 at 22:33

            You cant reference resource within itself: azurerm_container_group.aci_caddy.fqdn because it hasn't yet been created. You have to create new variable or local value for your SITE_ADDRESS.


            Community Discussions, Code Snippets contain sources that include Stack Exchange Network


            No vulnerabilities reported

            Install caddy

            The simplest, cross-platform way is to download from GitHub Releases and place the executable file in your PATH. For other install options, see
            Go 1.16 or newer
            The Caddy website has documentation that includes tutorials, quick-start guides, reference, and more. If you've only got a minute, the website has several quick-start tutorials to choose from! However, after finishing a quick-start tutorial, please read more documentation to understand how the software works. 🙂.


            Our website has complete documentation:. The docs are also open source. You can contribute to them here:
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
          • HTTPS


          • CLI

            gh repo clone caddyserver/caddy

          • sshUrl


          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Reuse Pre-built Kits with caddy

            Consider Popular Proxy Libraries


            by fatedier


            by shadowsocks


            by v2ray


            by caddyserver


            by XX-net

            Try Top Libraries by caddyserver


            by caddyserverGo


            by caddyserverCSS


            by caddyserverGo


            by caddyserverGo


            by caddyserverGo