NGINX Markdown for Agents
An NGINX module that converts HTML responses to Markdown format for AI agents through HTTP content negotiation.
Features
- Content negotiation via Accept header
- HTML to Markdown conversion
- Resource protection (size limits, timeouts)
- Caching support (planned)
Installation
Build the Rust converter:
cd rust-converter
cargo build --release
Build the NGINX module:
./configure --add-module=/path/to/nginx-markdown-for-agents/nginx-module
make
make install
Configuration
| Directive | Default | Description |
|---|---|---|
markdown_filter |
off |
Enable/disable conversion |
markdown_max_size |
10m |
Maximum response size |
markdown_timeout |
5s |
Conversion timeout |
Usage
Request Markdown content:
curl -H "Accept: text/markdown" https://example.com/page
Architecture
The module consists of two components:
- Rust Conversion Engine: Parses HTML and generates Markdown
- NGINX Module: Integrates with NGINX filter chain
Note: The module uses
synchronousasynchronous conversion for better performance.
Contributing
Contributions are welcome! Please read CONTRIBUTING.md for details.
License
This project is licensed under the MIT License - see the LICENSE file for details.