Combining Caddy with Nginx

If you have needs beyond what Caddy offers, you setup a reverse proxy to Nginx. Let’s look at an example where you would use Nginx for caching. I also added a separate block, in case you want to pass reverse proxy it back to Caddy again.

You may wonder, wouldn’t it be simpler to just run Nginx in that case? Maybe, maybe not. It all depends on your needs.

In the example below I have a WordPress configuration where you could easily switch between passing the request to Nginx and passing it straight to PHP. You would simply change with_nginx to without_nginx. It also shows how you could support for purging URLs for the nginx cache, without exposing the purge URLs beyond access for localhost.

I'm a webdeveloper based in Oslo, Norway. I currently work with web development at Nettmaker.

I would like to change the world, but they won't give me the source…

Leave a Reply

Your email address will not be published. Required fields are marked *