You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_All_`http-proxy`[options](https://github.com/nodejitsu/node-http-proxy#options) can be used, along with some extra `http-proxy-middleware`[options](#options).
60
74
61
-
:bulb:**Tip:** Set the option `changeOrigin` to `true` for [name-based virtual hosted sites](http://en.wikipedia.org/wiki/Virtual_hosting#Name-based).
Configure a logger to output information from http-proxy-middleware: ie. `console`, `winston`, `pino`, `bunyan`, `log4js`, etc...
318
330
331
+
Only `info`, `warn`, `error` are used internally for compatibility across different loggers.
332
+
333
+
If you use `winston`, make sure to enable interpolation: <https://github.com/winstonjs/winston#string-interpolation>
334
+
319
335
See also logger recipes ([recipes/logger.md](https://github.com/chimurai/http-proxy-middleware/blob/master/recipes/logger.md)) for more details.
320
336
321
337
```javascript
@@ -424,29 +440,35 @@ The following options are provided by the underlying [http-proxy](https://github
424
440
-**option.autoRewrite**: rewrites the location host/port on (301/302/307/308) redirects based on requested host/port. Default: false.
425
441
-**option.protocolRewrite**: rewrites the location protocol on (301/302/307/308) redirects to 'http' or 'https'. Default: null.
426
442
-**option.cookieDomainRewrite**: rewrites domain of `set-cookie` headers. Possible values:
443
+
427
444
-`false` (default): disable cookie rewriting
428
445
- String: new domain, for example `cookieDomainRewrite: "new.domain"`. To remove the domain, use `cookieDomainRewrite: ""`.
429
446
- Object: mapping of domains to new domains, use `"*"` to match all domains.
430
447
For example keep one domain unchanged, rewrite one domain and remove other domains:
448
+
431
449
```json
432
450
cookieDomainRewrite: {
433
451
"unchanged.domain": "unchanged.domain",
434
452
"old.domain": "new.domain",
435
453
"*": ""
436
454
}
437
455
```
456
+
438
457
- **option.cookiePathRewrite**: rewrites path of `set-cookie` headers. Possible values:
458
+
439
459
- `false` (default): disable cookie rewriting
440
460
- String: new path, for example `cookiePathRewrite: "/newPath/"`. To remove the path, use `cookiePathRewrite: ""`. To set path to root use `cookiePathRewrite: "/"`.
441
461
- Object: mapping of paths to new paths, use `"*"` to match all paths.
442
462
For example, to keep one path unchanged, rewrite one path and remove other paths:
0 commit comments