9
2 Comments

Generating SSL certs on-demand with caddy server

We at helpninja used Nginx as a reverse proxy to our backend.
During the development of Documentation feature, our requirements changed a bit. We allowed users to serve the docs on their custom domain, However, the challenge was to serving those domains over HTTPS. We started looking for a web server that generates SSL certs on demand and maintains them. Finally, we managed to get a working prototype with Openresty + Lua (lua-resty-auto-ssl) Plugin.
It all worked well, after having more than 50 custom domains we started facing issues with this setup. Resulted in performance degradation and sometimes Openresty gets crashed. So we started searching for alternatives and found caddy. Caddy offered lots of things out of the box.
Like ...

  • Automatic HTTPS generation
  • On-demand TLS with a little config
  • Simple and readable configuration

Here is our CaddyFile:

posted to Icon for group Developers
Developers
on November 4, 2019
  1. 1

    This is exactly what I am looking for. I am trying to figure it out from past few months and asking for help everywhere. I would really appreciate if you would help me!
    I am using PHP, Apache server to server my web app with MySQL, can you please help me figuring out how do allow https on custom domain and configure caddy?
    Appreciate it brother!!!

  2. 1

    This comment was deleted 6 years ago.

    1. 2

      We are creating a cname records when the user created a new doc site. User needs to add our cname records in their dns. Our caddy server receives the incoming requests and forward to node server. Node server will identify the site and serve the corresponding page.

      1. 2

        This comment was deleted 6 years ago.

Trending on Indie Hackers
5 days post-launch: Top 50 on Product Hunt, zero signups, and why I think that's actually fine User Avatar 140 comments 641 downloads, 2 sales, and I still don't know why User Avatar 111 comments I built an AI fitness coach, then realized AI was only solving half my funnel User Avatar 80 comments I built a macOS app to make mobile E2E testing less awful User Avatar 59 comments My AI agent quoted a client a price we killed months ago. So I built Engram. User Avatar 31 comments Show IH: I was my AI coding agent's memory — so I automated myself out of that job User Avatar 27 comments