New Fluxzy v2 just shipped. Electron is out, Tauri is in. gRPC ready, 3x smaller install. Learn more

forwardAction Action

Forward matching requests to an absolute URL, with automatic Host header rewriting and protocol switching.

Reverse proxy patterns usually require a dedicated server like nginx or HAProxy. forwardAction collapses that work into a single YAML rule, which is enough for migrations, debugging sessions, and ad hoc routing. Pair it with filters to target precisely the traffic you want to send elsewhere.

When to use this action

Use forwardAction when you want Fluxzy to behave like a reverse proxy and send matching requests to a completely different URL. Unlike spoofDnsAction, this action rewrites the Host header automatically and supports protocol switching, including HTTP to HTTPS and HTTP/1.1 to HTTP/2.

Typical situations include:

  • Redirecting calls from a deprecated hostname to its replacement during a migration.
  • Routing requests from a local development client to a remote staging environment.
  • Exposing a local mock server under a production looking hostname.
  • Building a quick A/B switch between two backends without touching the client.

The action runs on the requestHeaderReceivedFromClient scope. The url property must be an absolute URL including scheme, for example https://target.example.com.

Real world examples

Forward an entire host to a new backend

Useful during a migration when the client still calls the old URL.

rules:
- filter:
    typeKind: HostFilter
    pattern: legacy.example.com
  actions:
  - typeKind: ForwardAction
    url: https://new.example.com

Forward a path prefix to a different service

Splits one host across two upstreams using a path based rule.

rules:
- filter:
    typeKind: FilterCollection
    operation: And
    children:
    - typeKind: HostFilter
      pattern: api.internal.example.com
    - typeKind: PathFilter
      pattern: /v2/
  actions:
  - typeKind: ForwardAction
    url: https://api-v2.internal.example.com

Switch a client from HTTPS to a local HTTP server

Lets you debug a service locally without reconfiguring TLS in your client.

rules:
- filter:
    typeKind: HostFilter
    pattern: payments.example.com
  actions:
  - typeKind: ForwardAction
    url: http://localhost:5000

Reference

forwardAction

Description

Forward request to a specific URL. This action makes fluxzy act as a reverse proxy. Unlike SpoofDnsAction, host header is automatically set and protocol switch is supported (http to https, http/1.1 to h2, ...). The URL must be an absolute path.

Evaluation scope

Evaluation scope defines the timing where this filter will be applied.

requestHeaderReceivedFromClient This scope occurs the moment fluxzy parsed the request header receiveid from client

YAML configuration name

forwardAction

Settings

The following table describes the customizable properties available for this action:

Property Type Description DefaultValue
url string

Example of usage

The following examples apply this action to any exchanges

Forward any request to https://www.example.com.

rules:
- filter:
    typeKind: AnyFilter
  actions:
  - typeKind: ForwardAction
    url: https://www.example.com

.NET reference

View definition of ForwardAction for .NET integration.

See also

The following actions are related to this action:

Frequently asked questions

Does forwardAction rewrite the Host header automatically?

Yes. Fluxzy sets the Host header to match the destination URL so the upstream server sees a coherent request.

What is the difference between forwardAction and spoofDnsAction?

spoofDnsAction changes only the DNS resolution. forwardAction acts like a full reverse proxy: it rewrites Host, supports protocol switching, and points to an absolute URL.

Can I forward only part of the path?

The destination URL replaces the authority but the rest of the path is preserved. If you also need to rewrite the path, combine forwardAction with changeRequestPathAction.

Does it follow redirects from the new upstream?

No. Redirects are returned to the client just like any other response. The client decides whether to follow them.

Learn more about Fluxzy rules