From 9dc01ff28ad215d3f1cdbb9ae4586568877e4cd9 Mon Sep 17 00:00:00 2001 From: Louis-Marie GABORIT Date: Thu, 17 Feb 2022 19:12:49 +0100 Subject: [PATCH] firewall option replace with allowedHosts --- frontend/encore/virtual-machine.rst | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/frontend/encore/virtual-machine.rst b/frontend/encore/virtual-machine.rst index 23010b9f169..04f3c16b1f1 100644 --- a/frontend/encore/virtual-machine.rst +++ b/frontend/encore/virtual-machine.rst @@ -96,7 +96,7 @@ Fix "Invalid Host header" Issue ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Webpack will respond ``Invalid Host header`` when trying to access files from -the dev-server. To fix this, set the ``firewall`` option: +the dev-server. To fix this, set the ``allowedHosts`` option: .. code-block:: javascript @@ -107,16 +107,15 @@ the dev-server. To fix this, set the ``firewall`` option: // ... .configureDevServerOptions(options => { - options.firewall = false; + options.allowedHosts = all; }) .. caution:: - Beware that `it's not recommended to disable the firewall`_ in general, but - here it's required to solve the issue when using Encore in a virtual machine. + Beware that `it's not recommended to set allowedHosts to all`_. Read the dedicated doc to select the value for your environment. .. _`VirtualBox`: https://www.virtualbox.org/ .. _`VMWare`: https://www.vmware.com .. _`NFS`: https://en.wikipedia.org/wiki/Network_File_System .. _`polling`: https://webpack.js.org/configuration/watch/#watchoptionspoll -.. _`it's not recommended to disable the firewall`: https://webpack.js.org/configuration/dev-server/#devserverdisablehostcheck +.. _`it's not recommended to set allowedHosts to all`: https://webpack.js.org/configuration/dev-server/#devserverallowedhosts