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.
Here are some other posts you may like
Electric power companies, in general, are pretty much the same. Tibber however, is unlike any electricity company I had seen before. They try to utilise the data we get from smart devices, which they also sell, to save electricity, money and the environment, as well as improving comfort. It’s a…
Load balancers are incredibly useful when a single server isn't capable of handling the load or if you wan't greater reliability. But what if bandwidth is the limiting factor, what do you do then? And what tools from the Digital Ocean toolbox can you use? In a recent project I…
For a second there, I had my doubts about being able to score 100% on multiple tests at the same time – but now I know that it can be done. The first 100% was from Pingdom, after which I started on the GTMetrix test. The problem was that by…