# Nginx Config Generator

> Nginx Config Generator is a paid API for AI agents from api.strale.io, paid per call via x402, $0.054001/call, status unknown (last checked 2026-10-11).

Generates production-ready nginx server blocks with SSL, proxy_pass, WebSocket support, security headers, gzip compression, and rate limiting for a given domain.

## Facts

- Endpoint: GET https://api.strale.io/x402/nginx-config-generate?utm_source=zero.xyz
- Price: $0.054001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-strale-io-ec24ce28
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Gd35-sV4vT0cAhSeKvRUo

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability api-strale-io-ec24ce28
```

Example prompt: Generate a production nginx server block for app.example.com with SSL enabled, gzip on, rate limiting at 100 requests per second, www redirect, and proxying to upstream port 3000.

## When to prefer this

Use this endpoint when you need to programmatically generate a complete, production-grade nginx server block without manually writing config files. Ideal for CI/CD pipelines, infrastructure-as-code workflows, or onboarding new services. Prefer this over generic config templates when you need SSL, WebSocket support, gzip, rate limiting, and security headers all pre-configured and ready to deploy.

## Known failure modes

- Missing required 'domain' query parameter returns a 400 or validation error
- Invalid domain format may produce a malformed config
- Unsupported HTTP method (POST, PUT, etc.) returns 405
- Payment failure or insufficient USDC balance returns 402
- Rate limit exceeded on the API itself returns 429

## How this service works

Generate production nginx server blocks with SSL, proxy_pass, WebSocket support, security headers, gzip, rate limiting.

## Output

Returns a production-ready nginx server block configuration as text or structured output, including SSL directives, proxy_pass to the specified upstream port, WebSocket support, security headers, gzip compression rules, and rate limiting directives — ready to drop into /etc/nginx/sites-available.

## Example request

```json
{
 "ssl": true,
 "gzip": true,
 "domain": "api.example.com",
 "rate_limit": 100,
 "www_redirect": true,
 "upstream_port": 3000
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "domain"
     ],
     "properties": {
      "ssl": {
       "type": "boolean"
      },
      "gzip": {
       "type": "boolean"
      },
      "domain": {
       "type": "string"
      },
      "rate_limit": {
       "type": "integer"
      },
      "www_redirect": {
       "type": "boolean"
      },
      "upstream_port": {
       "type": "integer"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-strale-io-ec24ce28/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.strale.io](https://www.zero.xyz/host/api.strale.io/llms.txt)
