Skip to content
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
2f79384
clustering_with_ddev.md: Install reverse proxy
adriendupuis Jan 8, 2026
a8d4f45
clustering_with_ddev.md: Fix ngrok link
adriendupuis Jan 8, 2026
07c16c7
clustering_with_ddev.md: web's proxy config
adriendupuis Jan 8, 2026
edd500e
clustering_with_ddev.md: Fix parameters.vcl edition
adriendupuis Jan 9, 2026
04cbbfc
clustering_with_ddev.md: Update script description
adriendupuis Jan 9, 2026
d55279f
clustering_with_ddev.md: Fix invalidators; Add ddev varnishlog
adriendupuis Jan 9, 2026
12058fd
clustering_with_ddev.md: Update script description
adriendupuis Jan 9, 2026
565b58b
clustering_with_ddev.md: Update script description
adriendupuis Jan 9, 2026
edc40d6
clustering_with_ddev.md: TRUSTED_PROXIES
adriendupuis Jan 9, 2026
fb8644b
clustering_with_ddev.md: Fastly
adriendupuis Jan 9, 2026
5f028d2
clustering_with_ddev.md: more info
adriendupuis Jan 9, 2026
1aad23b
clustering_with_ddev.md: more info
adriendupuis Jan 9, 2026
ce983eb
clustering_with_ddev.md: Fix style (vale)
adriendupuis Jan 12, 2026
ec04b5f
Apply suggestions from code review
adriendupuis Jan 14, 2026
f99b46a
Apply suggestion from @adriendupuis
adriendupuis Jan 14, 2026
1fa6804
Apply suggestion from @adriendupuis
adriendupuis Jan 21, 2026
e1a671a
Merge branch '5.0' into ddev-varnish
adriendupuis Jan 21, 2026
528563b
Apply suggestions from code review
adriendupuis Jan 21, 2026
e3bfc13
Apply suggestions from code review
adriendupuis Jan 21, 2026
c8eb0ee
Apply suggestions from code review
adriendupuis Jan 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 123 additions & 0 deletions docs/infrastructure_and_maintenance/clustering/clustering_with_ddev.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,129 @@

To run an [[= product_name_cloud =]] project locally, you may refer to [DDEV and Ibexa Cloud](ddev_and_ibexa_cloud.md) instead.

## Install reverse proxy

A reverse proxy can be added to the cluster to enable [HTTP caching](http_cache.md).

### Varnish
Comment on lines +30 to +34

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add an introduction sentence hear linking to HTTP cache doc, for people unfalimiar with it


The following sequence of commands:

1. Sets a variable with the desired Varnish version, here Varnish 7.1
2. Copies and customizes `parameters.vcl` file in `.ddev/varnish/` (which is mounted as `/etc/varnish/` into the container):
- sets `web` container as the backend host and an invalidator (so back office can purge cache)
- adds "all IPs" CIDR notation to `debuggers` list to allow debugging from any IP
- on Varnish 7, enable logging of access control list matching for both `invalidators` and `debuggers` lists
(new Varnish 7 syntax, it was enabled by default on previous versions)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel this could be part of HTTP cache doc - and just linked from here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mnocon I found no clear ACL explanation in our doc to add a +log to. This is something to keep for later.

3. Sets main `varnish*.vcl` file to use and "path to VCL directory" argument name depending on Varnish version
4. Copies the main VCL file to `.ddev/varnish/`
5. Sets the Varnish version to use and its demon starting parameters to use the files
6. Adds the Varnish container
7. Sets Varnish as the HTTP cache server
8. Restarts the DDEV cluster and clear the [[= product_name =]] cache

```bash
VARNISH_VERSION=7.1
mkdir -p .ddev/varnish
sed 's/.host = "127.0.0.1";/.host = "web";/' vendor/ibexa/http-cache/docs/varnish/vcl/parameters.vcl > .ddev/varnish/parameters.vcl
Comment thread
adriendupuis marked this conversation as resolved.
sed -i '/^acl invalidators {$/a \\ "web";' .ddev/varnish/parameters.vcl
sed -i '/^acl debuggers {$/a \\ "0.0.0.0"/0; \/\/ debug from any IP' .ddev/varnish/parameters.vcl
if [[ $VARNISH_VERSION == 7.* ]]; then
sed -i 's/acl invalidators {/acl invalidators +log {/' .ddev/varnish/parameters.vcl
sed -i 's/acl debuggers {/acl debuggers +log {/' .ddev/varnish/parameters.vcl
vcl_path=vcl_path
vcl_file=varnish7.vcl
elif [[ $VARNISH_VERSION == 6.* ]]
vcl_path=vcl_dir
vcl_file=varnish6.vcl
fi
cp vendor/ibexa/http-cache/docs/varnish/vcl/$vcl_file .ddev/varnish/
ddev dotenv set .ddev/.env.varnish --varnish-docker-image=varnish:$VARNISH_VERSION --varnish-varnishd-params " -p $vcl_path=/etc/varnish -f /etc/varnish/$vcl_file"

ddev get ddev/ddev-varnish

ddev config --web-environment-add HTTPCACHE_PURGE_SERVER=http://varnish
ddev config --web-environment-add HTTPCACHE_PURGE_TYPE=varnish
ddev config --web-environment-add TRUSTED_PROXIES=varnish

ddev restart
Comment thread
adriendupuis marked this conversation as resolved.
ddev php bin/console cache:clear
```

To use Varnish 6.0LTS, set the following variable instead:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about Varnish 5?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 is not officially supported anymore even if the varnish5.vcl file is still there
https://doc.ibexa.co/en/5.0/getting_started/requirements/#clustering

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, but then we have a mismatch with this part of the script:

elif [[ $VARNISH_VERSION == 5.* ]]
  vcl_path=vcl_dir
  vcl_file=varnish5.vcl
fi

It should be unified - either we mention Varnish 5 with all info, or we skip it completely

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm about to remove it from script

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed from script in e3bfc13

Side note, I also removed/updated a link to this v5 file in #3020


```bash
VARNISH_VERSION=6.0
Comment thread
adriendupuis marked this conversation as resolved.
```

If you're using [Apache as web server](install_with_ddev.md#switch-to-apache-and-its-virtual-host),
you must set `varnish` as a trusted proxy in `.ddev/apache/apache-site.conf` before restarting DDEV:

```bash
sed -i 's/#SetEnv TRUSTED_PROXIES ""/SetEnv TRUSTED_PROXIES "varnish"/' .ddev/apache/apache-site.conf

ddev restart
```

The Varnish server acts as the application’s primary entry point.
If you run `ddev describe`, you can see that Varnish is now the one responding to DDEV domain `.ddev.site`
while the web server still replies to `127.0.0.1` with its own ports.

You can see Varnish headers in HTTP responses, for example:

```console
% curl -s -c cookies.txt -b cookies.txt -I https://<your-project>.ddev.site:<https-port>/
Comment thread
adriendupuis marked this conversation as resolved.
HTTP/2 200

Check warning on line 102 in docs/infrastructure_and_maintenance/clustering/clustering_with_ddev.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/infrastructure_and_maintenance/clustering/clustering_with_ddev.md#L102

[Ibexa.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[Ibexa.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/infrastructure_and_maintenance/clustering/clustering_with_ddev.md", "range": {"start": {"line": 102, "column": 11}}}, "severity": "WARNING"}
server: Apache/2.4.65 (Debian)
vary: Origin,X-Editorial-Mode
via: 1.1 varnish (Varnish/7.1)
x-cache: HIT
x-cache-debug: 1
x-cache-hits: 5
x-cache-ttl: 87654.321
x-debug-token: 012345
x-debug-token-link: https://<your-project>.ddev.site:<https-port>//_profiler/012345
x-powered-by: Ibexa Commerce v5
x-robots-tag: noindex
x-varnish: 12345 67890
xkey: ez-all c52 ct42 l2 pl1 p1 p2
content-length: 45678
```

You can see how the `web` server is responding to `varnish`:
Comment thread
adriendupuis marked this conversation as resolved.

```console
% curl -s -H "Surrogate-Capability: abc=ESI/1.0" http://127.0.0.1:<http-web-port>/product-catalog | grep 'esi:include'
Comment thread
adriendupuis marked this conversation as resolved.
<esi:include src="/_fragment?_hash=…
```

To explore more the communication between the web server and Varnish, you can find other examples of requests done directly to the web server while impersonating Varnish in [Fetching user context hash](content_aware_cache.md#fetching-user-context-hash) and [Fetching HTML response](content_aware_cache.md#fetching-html-response).

You can use `ddev varnishlog` command to monitor Varnish logs in real time.
Due to how parameters are passed to the container, you may have to wrap some parameters in quotes twice, for example, the purge request monitoring:

```bash
ddev varnishlog -q "'ReqMethod ~ PURGE.*'";
```

For more information on topics such as available configurations, command lines, or monitoring, see [ddev/ddev-varnish README](https://github.com/ddev/ddev-varnish).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link again to http cache for more info how to use that with Ibexa? That's up to you

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see what to link to in the actual state of our doc.
Kept for later.


### Fastly

For Fastly (as for [[[= product_name_connect =]]](https://doc.ibexa.co/projects/connect/en/latest/)), the instance must be visible from Internet.

To use [ngrok](https://ngrok.com/) alongside [`ddev share`](https://docs.ddev.com/en/stable/users/topics/sharing/#using-ddev-share-easiest) is probably the easiest way to achieve this.

Be careful when making a local development instance visible from the internet.
For example:

- close ngrok tunnels when not needed anymore
- keep your ngrok URL private and share it only with trusted recipients
- don't use it for live demo where the URL could be seen
- don't store it on a Fastly or [[= product_name_connect =]] accounts used by external people

See [Configure and customize Fastly](fastly.md) for the Fastly side.

## Install search engine

A [search engine](search_engines.md) can be added to the cluster.
Expand Down