Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 56990f9

Browse files
firewall option replace with allowedHosts
1 parent b790aee commit 56990f9

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

frontend/encore/virtual-machine.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Fix "Invalid Host header" Issue
9696
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9797

9898
Webpack will respond ``Invalid Host header`` when trying to access files from
99-
the dev-server. To fix this, set the ``firewall`` option:
99+
the dev-server. To fix this, set the ``allowedHosts`` option:
100100

101101
.. code-block:: javascript
102102
@@ -107,16 +107,17 @@ the dev-server. To fix this, set the ``firewall`` option:
107107
// ...
108108
109109
.configureDevServerOptions(options => {
110-
options.firewall = false;
110+
options.allowedHosts = all;
111111
})
112112
113+
// webpack-dev-server < 4.0.0
114+
options.firewall = false;
113115
.. caution::
114116

115-
Beware that `it's not recommended to disable the firewall`_ in general, but
116-
here it's required to solve the issue when using Encore in a virtual machine.
117+
Beware that `it's not recommended to set allowedHosts to all`_. Read the dedicated doc to select the value for your environment.
117118

118119
.. _`VirtualBox`: https://www.virtualbox.org/
119120
.. _`VMWare`: https://www.vmware.com
120121
.. _`NFS`: https://en.wikipedia.org/wiki/Network_File_System
121122
.. _`polling`: https://webpack.js.org/configuration/watch/#watchoptionspoll
122-
.. _`it's not recommended to disable the firewall`: https://webpack.js.org/configuration/dev-server/#devserverdisablehostcheck
123+
.. _`it's not recommended to set allowedHosts to all`: https://webpack.js.org/configuration/dev-server/#devserverallowedhosts

0 commit comments

Comments
 (0)