a6-plugin-response-rewrite

Configure APISIX response-rewrite plugin on routes and services via a6 CLI.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps operators modify APISIX responses on the fly—altering status codes, headers, and bodies to meet compliance, security, or UX requirements without invasive upstream changes.

Core Features & Use Cases

  • Rewrite response status codes, headers, and bodies for routes and services.
  • Conditional rewrites using vars and regex filters to apply changes only in specific scenarios.
  • Support for base64-encoded bodies and dynamic header values for adaptable responses.

Quick Start

Configure a route with the response-rewrite plugin to modify status, headers, and body for a targeted URI.

Frequently Asked Questions about a6-plugin-response-rewrite

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

FAQPage Schema
How do I rewrite APISIX response headers and body without changing the upstream service?

To rewrite APISIX response headers and body without upstream changes, configure the response-rewrite plugin on routes or services via the a6 CLI. This allows operators to alter status codes, headers, and bodies on the fly to meet compliance, security, or UX requirements.

Can I apply conditional logic to modify APISIX responses only for specific scenarios?

Yes, you can apply conditional logic to APISIX responses by using vars and regex filters within the response-rewrite plugin. This conditional configuration ensures that status codes, headers, and body rewrites execute only when specific defined scenarios are matched.

How does base64 encoding work when rewriting APISIX response bodies?

Base64 encoding for rewriting APISIX response bodies allows operators to safely modify complex or binary body content. The response-rewrite plugin supports base64-encoded bodies, enabling adaptable response modifications directly on routes and services through the a6 CLI.

Does the response-rewrite plugin support dynamic HTTP header values for APISIX routes?

Yes, the response-rewrite plugin supports dynamic HTTP header values for APISIX routes. Operators can configure these dynamic headers alongside status code and body rewrites to generate adaptable API responses without implementing invasive upstream service changes.

What is the best way to change APISIX response status codes for compliance requirements?

The best way to change APISIX response status codes for compliance is configuring the response-rewrite plugin on targeted routes and services. This approach modifies responses on the fly, ensuring compliance, security, or UX requirements are met without altering upstream logic.

When should I not use APISIX response rewrite rules for modifying API responses?

You should not use APISIX response rewrite rules when invasive upstream changes are required for complex data transformations. The response-rewrite plugin handles status codes, headers, and base64 bodies via regex conditional logic, but may not suit scenarios needing deep application-level data processing.