Http-proxy-middleware: Middleware is not rewriting requests for index.html

Created on 5 Jul 2018  路  1Comment  路  Source: chimurai/http-proxy-middleware

Expected behavior

Should rewrite request to https://localhost/app/index.html

Actual behavior

Request is handled by local web pack server and not rewritten

Setup

proxy middleware configuration

const PROXY_CONFIG = [
  {
    context: [
      '/client-config',
      '/api',
      '/brand',
      'index.html'
    ],
    'target': 'https://localhost/app/',
    'autoRewrite': true,
    'secure': false,
    'changeOrigin': false,
    'logLevel': 'debug',
    'bypass': function (req, res, proxyOptions) {
    }
  }
];

module.exports = PROXY_CONFIG;

The proxy middleware seems to completely ignore requests for index.html and hands them off to the web pack dev server. The other routes define (client-config,brand, api) all work

Most helpful comment

I have this bug too.

>All comments

I have this bug too.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nikksan picture nikksan  路  3Comments

kimmobrunfeldt picture kimmobrunfeldt  路  5Comments

gajus picture gajus  路  8Comments

lukaszpochrzest picture lukaszpochrzest  路  3Comments

noahgrant picture noahgrant  路  4Comments