Home > Enterprise >  Invalid Host header Vue3
Invalid Host header Vue3

Time:08-30

Just uploaded project files and configured nginx. Everything seems working fine without any errors. However, whenever I visit the domain I see the message 'Invalid Host header'. Followed by many solutions with vue.config.js file, none of them did a trick. The file is created in the same root level with package.json and src folder. Here's how it looks:

module.exports = {
   devServer: {
        disableHostCheck: true
    }
};

Also, tried this solution:

devServer: {
    allowedHosts: [
      'yourdomain.com'
    ]
}

Here's the part from the /sites-available file

server {
        location / {
        proxy_pass http://localhost:8080;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
        }
    }

CodePudding user response:

For some reasons the project always been running on 8081 port, just had to check logs more carefully. Updating proxy_pass solved it

  • Related