Vue error: Invalid Host Header

Handwritten on 02 Jul 2019

Description

Getting the Invalid Host Header error when bootstrapping a new Vue.js app. This app is served behind a nginx proxy: http://client.go/.

Solution

Solution is to create a config file in the root of your Vue.js app: vue.config.js:

// This is an optional file but needed when serving Vue 
// behind a proxy, we need to disable host checks.
module.exports = {
  devServer: {
    disableHostCheck: true
  }
}

More info

Logo Adis.me

© 2024 Handcrafted in Nijmegen, The Netherlands