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
Narrow down which requests should be proxied. The `path` used for filtering is the `request.url` pathname. In Express, this is the `path` relative to the mount-point of the proxy.
162
162
163
163
-**path matching**
164
-
165
164
-`createProxyMiddleware({...})` - matches any path, all requests will be proxied when `pathFilter` is not configured.
166
165
-`createProxyMiddleware({ pathFilter: '/api', ...})` - matches paths starting with `/api`
For fine-grained control you can use wildcard matching. Glob pattern matching is done by _micromatch_. Visit [micromatch](https://www.npmjs.com/package/micromatch) or [glob](https://www.npmjs.com/package/glob) for more globbing examples.
175
-
176
173
-`createProxyMiddleware({ pathFilter: '**', ...})` matches any path, all requests will be proxied.
177
174
-`createProxyMiddleware({ pathFilter: '**/*.html', ...})` matches any path which ends with `.html`
178
175
-`createProxyMiddleware({ pathFilter: '/*.html', ...})` matches paths directly under path-absolute
@@ -416,13 +413,12 @@ The following options are provided by the underlying [http-proxy](https://github
416
413
-**option.autoRewrite**: rewrites the location host/port on (301/302/307/308) redirects based on requested host/port. Default: false.
417
414
-**option.protocolRewrite**: rewrites the location protocol on (301/302/307/308) redirects to 'http' or 'https'. Default: null.
418
415
-**option.cookieDomainRewrite**: rewrites domain of `set-cookie` headers. Possible values:
419
-
420
416
-`false` (default): disable cookie rewriting
421
417
- String: new domain, for example `cookieDomainRewrite: "new.domain"`. To remove the domain, use `cookieDomainRewrite: ""`.
422
418
- Object: mapping of domains to new domains, use `"*"` to match all domains.
423
419
For example keep one domain unchanged, rewrite one domain and remove other domains:
424
420
425
-
```json
421
+
```jsonc
426
422
cookieDomainRewrite: {
427
423
"unchanged.domain":"unchanged.domain",
428
424
"old.domain":"new.domain",
@@ -431,13 +427,12 @@ The following options are provided by the underlying [http-proxy](https://github
431
427
```
432
428
433
429
-**option.cookiePathRewrite**: rewrites path of`set-cookie`headers. Possible values:
434
-
435
430
-`false` (default): disable cookie rewriting
436
431
-String:newpath, for example `cookiePathRewrite: "/newPath/"`. To remove the path, use `cookiePathRewrite: ""`. To set path to root use `cookiePathRewrite: "/"`.
437
432
-Object: mapping of paths to newpaths, use `"*"` to match all paths.
438
433
For example, to keep one path unchanged, rewrite one path and remove other paths:
0 commit comments