docksal / service-varnish

Varnish Docker image for Docksal
MIT License
2 stars 12 forks source link

Connecting varnish up to individual sites in Drupal multisite? #3

Closed lpeabody closed 6 years ago

lpeabody commented 7 years ago

Say we have a multisite codebase. The default site has a host of defaultsite.docksal/ and is accessible via Varnish at varnish.defaultsite.docksal/.

How do you connect every other site up to varnish? I'm following the instructions here http://docksal.readthedocs.io/en/master/advanced/multiple-projects/.

lmakarov commented 7 years ago

Your best bet would be to use siteX.varnish.defaultsite.docksal for the multisite domains served by Varnish.

This can be achieved by appending the io.docksal.virtual-host label in the Varnish service settings like this:

  ...
  labels:
    - io.docksal.virtual-host=varnish.${VIRTUAL_HOST},*.varnish.${VIRTUAL_HOST}

Something like varnish.*.${VIRTUAL_HOST} is currently not supported bydocksal-vhost-proxy.

lpeabody commented 7 years ago

Thanks @lmakarov looks like that will work nicely. I haven't had time to implement it yet, but will post back here once I've done so.

lmakarov commented 6 years ago

Closing for inactivity. Feel free to followup.