From 9939d16cee911589399c73dd783360dfa334c57c Mon Sep 17 00:00:00 2001 From: Marvin Sanders Date: Mon, 20 Nov 2023 16:58:33 +0100 Subject: [PATCH 1/2] update the varnish docs of shopware6 --- ...how-to-configure-varnish-for-shopware-6.md | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/docs/ecommerce-applications/shopware-6/how-to-configure-varnish-for-shopware-6.md b/docs/ecommerce-applications/shopware-6/how-to-configure-varnish-for-shopware-6.md index 9a2bc478..9891de37 100644 --- a/docs/ecommerce-applications/shopware-6/how-to-configure-varnish-for-shopware-6.md +++ b/docs/ecommerce-applications/shopware-6/how-to-configure-varnish-for-shopware-6.md @@ -88,7 +88,27 @@ location ~ \.php$ { Go to [Shopware's Reverse Http Cache documentation](https://developer.shopware.com/docs/guides/hosting/infrastructure/reverse-http-cache) to configure Shopware to take Varnish into account. -For the correct hosts: `[ "http://varnish" ]`, use localhost or varnish on port 6081, for instance: hosts: `[ "http://127.0.0.1:6081" ]`. +First, we need to enable reverse proxy support in Shopware. To do this, we must create a new file in `config/packages/storefront.yaml`: +```php +storefront: + reverse_proxy: + enabled: true + ban_method: "BAN" + # This should point to your Varnish hosts + hosts: [ "http://varnish:6081" ] + # Maximum parallel invalidations at the same time for a single worker + max_parallel_invalidations: 3 + # Redis Storage for the HTTP cache tags + redis_url: "redis://redismaster:6379" +``` +To assist you further, modify the following settings: + +`http://varnish` to `http://varnish:6081` +`redis://redis` to `redis://redismaster:6379/` + +Also, set `SHOPWARE_HTTP_CACHE_ENABLED=1` in your `.env` file. + +For the correct Varnish VCL configuration and additional settings, refer to the docs: [Shopware's Reverse Http Cache documentation](https://developer.shopware.com/docs/guides/hosting/infrastructure/reverse-http-cache). ## Step Four: Implement a .vcl Into Varnish From 3463c5fbb20f178a4a04ea9d975758330379ee81 Mon Sep 17 00:00:00 2001 From: Marvin Sanders Date: Mon, 20 Nov 2023 17:26:32 +0100 Subject: [PATCH 2/2] Fix the md format --- .../shopware-6/how-to-configure-varnish-for-shopware-6.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/ecommerce-applications/shopware-6/how-to-configure-varnish-for-shopware-6.md b/docs/ecommerce-applications/shopware-6/how-to-configure-varnish-for-shopware-6.md index 9891de37..6f7b6b49 100644 --- a/docs/ecommerce-applications/shopware-6/how-to-configure-varnish-for-shopware-6.md +++ b/docs/ecommerce-applications/shopware-6/how-to-configure-varnish-for-shopware-6.md @@ -101,6 +101,7 @@ storefront: # Redis Storage for the HTTP cache tags redis_url: "redis://redismaster:6379" ``` + To assist you further, modify the following settings: `http://varnish` to `http://varnish:6081` @@ -108,7 +109,8 @@ To assist you further, modify the following settings: Also, set `SHOPWARE_HTTP_CACHE_ENABLED=1` in your `.env` file. -For the correct Varnish VCL configuration and additional settings, refer to the docs: [Shopware's Reverse Http Cache documentation](https://developer.shopware.com/docs/guides/hosting/infrastructure/reverse-http-cache). +For the correct Varnish VCL configuration and additional settings, refer to the docs: [Shopware's Reverse Http Cache documentation](https://developer.shopware.com/docs/guides/hosting/infrastructure/reverse-http-cache) + ## Step Four: Implement a .vcl Into Varnish