Skip to content
This repository has been archived by the owner on Nov 3, 2024. It is now read-only.

Latest commit

 

History

History
22 lines (16 loc) · 1.23 KB

File metadata and controls

22 lines (16 loc) · 1.23 KB

Varnish

This recipe allows you to configure a Varnish reverse proxy for your project.

The Varnish service inserts itself between ddev-router and the web container, so that calls to the web container are routed through Varnish first. The docker-compose.varnish.yaml replaces the VIRTUAL_HOST variable of the web container with a subdomain of the website URL (see below) and uses the default domain as its own host name.

To enable Varnish in your project follow these steps:

  1. Copy docker-compose.varnish.yaml into your project's .ddev directory.
  2. Create a directory named varnish in your project's .ddev directory.
  3. Copy the default.vcl in this directoy.
  4. Run ddev start.
  5. From now on calls to the web container (e.g. https://example.ddev.site) are routed through Varnish. If you would like to access the site without Varnish, simply prepend the URL with novarnish. (e.g. https://novarnish.example.ddev.site).

Based on the work of rikwillems.