a6-plugin-proxy-rewrite

Configure APISIX proxy-rewrite plugin to rewrite URIs, headers, host, method, and scheme.

1|2|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/api7/a6 --skill a6-plugin-proxy-rewrite-api7
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: a6-plugin-proxy-rewrite
Source: https://github.com/api7/a6/tree/main/skills/a6-plugin-proxy-rewrite
Command: npx skills add https://github.com/api7/a6 --skill a6-plugin-proxy-rewrite-api7

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

APISIX users need a flexible way to modify requests at the edge before they reach upstream. The proxy-rewrite plugin provides a declarative method to adjust URI, host, method, headers, and scheme, enabling routing adjustments without backend changes.

Core Features & Use Cases

  • Rewrites URI via uri or regex_uri with precedence rules.
  • Modify request headers (set, add, remove) and host header for upstream routing.
  • Change HTTP method or scheme to suit backend constraints.
  • Use cases: path prefix stripping, host header shaping, or protocol switching for blue/green deployments.

Quick Start

Create a route with the proxy-rewrite plugin to transform incoming requests for the target upstream.

Frequently Asked Questions about a6-plugin-proxy-rewrite

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I rewrite request URI and headers at the edge before reaching upstream?

You can rewrite request URI and headers at the edge by configuring the APISIX proxy-rewrite plugin on a route, adjusting URI, host, method, headers, and scheme before traffic reaches upstream.

How does regex URI rewriting work in APISIX routing?

Regex URI rewriting in APISIX routing uses the regex_uri field to match incoming request paths and replace them with a new pattern, enabling dynamic path transformations based on regular expressions.

Can I strip a path prefix and modify the host header for upstream routing?

Yes, you can strip a path prefix and modify the host header simultaneously by using the proxy-rewrite plugin to set the uri and override the host header for upstream routing.

Does the proxy-rewrite plugin support changing HTTP method and scheme?

The proxy-rewrite plugin supports changing HTTP method and scheme, allowing you to switch requests from GET to POST or HTTP to HTTPS to suit specific backend constraints.

What is the precedence when applying multiple rewrite rules to a single route?

When applying multiple rewrite rules, the proxy-rewrite plugin enforces specific precedence rules for URI, regex_uri, and header operations, ensuring safe defaults and predictable request transformations.

Why use edge request rewriting instead of modifying backend code for blue/green deployments?

Edge request rewriting enables protocol switching and routing adjustments for blue/green deployments without backend code changes, providing a declarative method to shape requests at the APISIX gateway.