File tree Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -96,26 +96,27 @@ Fix "Invalid Host header" Issue
96
96
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
97
97
98
98
Webpack will respond ``Invalid Host header `` when trying to access files from
99
- the dev-server. To fix this, add the argument `` --disable-host-check `` :
99
+ the dev-server. To fix this, set the `` firewall `` option :
100
100
101
- .. code-block :: diff
101
+ .. code-block :: javascript
102
102
103
- {
104
- ...
105
- "scripts": {
106
- - "dev-server": "encore dev-server --public http://app.vm:8080 --host 0.0.0.0",
107
- + "dev-server": "encore dev-server --public http://app.vm:8080 --host 0.0.0.0 --disable-host-check",
108
- ...
109
- }
110
- }
103
+ // webpack.config.js
104
+ // ...
105
+
106
+ Encore
107
+ // ...
108
+
109
+ .configureDevServerOptions (options => {
110
+ options .firewall = false ;
111
+ })
111
112
112
113
.. caution ::
113
114
114
- Beware that `it's not recommended to disable host checking `_ in general, but
115
+ Beware that `it's not recommended to disable the firewall `_ in general, but
115
116
here it's required to solve the issue when using Encore in a virtual machine.
116
117
117
118
.. _`VirtualBox` : https://www.virtualbox.org/
118
119
.. _`VMWare` : https://www.vmware.com
119
120
.. _`NFS` : https://en.wikipedia.org/wiki/Network_File_System
120
121
.. _`polling` : https://webpack.js.org/configuration/watch/#watchoptionspoll
121
- .. _`it's not recommended to disable host checking ` : https://webpack.js.org/configuration/dev-server/#devserverdisablehostcheck
122
+ .. _`it's not recommended to disable the firewall ` : https://webpack.js.org/configuration/dev-server/#devserverdisablehostcheck
You can’t perform that action at this time.
0 commit comments