a6-plugin-response-rewrite

Configure the Apache APISIX response-rewrite plugin to modify HTTP status codes, headers, and bodies.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill allows you to dynamically modify HTTP responses sent by Apache APISIX, enabling customization of status codes, headers, and bodies before they reach the client.

Core Features & Use Cases

  • Response Modification: Change HTTP status codes, add/remove/set headers, and replace the response body.
  • Conditional Logic: Apply rewrites based on specific conditions using vars.
  • Regex Filtering: Modify parts of the response body using regular expressions.
  • Use Case: Automatically add security headers like Strict-Transport-Security to all responses, or return a custom error message with a 503 status code when a service is under maintenance.

Quick Start

Use the a6-plugin-response-rewrite skill to add the 'X-Content-Type-Options: nosniff' header to all responses for the '/api/*' route.

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 modify HTTP response headers in APISIX?

Use the response-rewrite plugin to dynamically add, remove, or set HTTP headers on APISIX responses before they reach the client.

Can I change the HTTP status code returned by an APISIX route?

Yes, you can change the HTTP status code returned by an APISIX route by using the response-rewrite plugin to override the original status code, such as returning a 503 during maintenance.

How do I use regex to filter or replace an APISIX response body?

You can use regex-based body filtering with the response-rewrite plugin to match and modify specific parts of the HTTP response body on the fly using regular expressions.

How to apply conditional logic when rewriting APISIX responses?

Apply conditional logic to APISIX response rewriting by using the vars field in the response-rewrite plugin to execute header or body modifications only when specific conditions are met.

Does the APISIX response-rewrite plugin support serving base64-decoded content?

Yes, the APISIX response-rewrite plugin supports advanced use cases like serving base64-decoded content and performing dynamic header injection for modified HTTP responses.