New — Iris AI drafts your firewall, routing & rate-limit rules. Explore AI features →
Back to Blog
tutorialgatewaysecurityapi-gatewaytunneling

Building an Edge Gateway: From Zero to Production

A practical guide to setting up a production-grade edge gateway with WAF, per-endpoint auth, load balancing, and multi-region deployment in under an hour.

3 min read

Setting up a production-grade edge gateway used to mean configuring Nginx, managing SSL certificates, setting up a WAF, wiring up authentication, configuring DNS records, and monitoring it all. It was a multi-day project for each new service.

With Ngris, you can go from zero to a fully configured production edge gateway in under an hour. Here's how.

Step 1: Install and Connect

# Install Ngris

curl -sSL https://ngris.com/install.sh | sh

# Expose your local server

ngris http 3000

That's it. Your local server is now accessible via a public URL with TLS termination. But that's just the start.

Step 2: Add a Custom Domain

In the Ngris dashboard, navigate to your endpoint and add a custom domain. Ngris automatically provisions DNS records and TLS certificates via Let's Encrypt. No manual certificate management.

# Or configure via CLI

ngris domain add api.yourcompany.com

Step 3: Enable the WAF

Ngris includes a traffic-policy engine with 23 rule types across four phases — among them a built-in, Coraza-powered Web Application Firewall. Enable it with one click in the dashboard or via the API:

# Enable default WAF ruleset

ngris waf enable --ruleset default

# Add custom rate limiting

ngris waf rule add --type rate-limit --limit 100/minute

The default ruleset covers: SQL injection, XSS, path traversal, command injection, HTTP method filtering, bot detection, and more. You can also use AI-powered analysis to generate custom rules based on your traffic patterns.

Step 4: Configure Authentication

Per-endpoint access control is built in. Choose from multiple auth methods:

Basic Auth

Username/password with bcrypt hashing. Set up in seconds.

OAuth Providers

Google, GitHub, SAML/OIDC for team and enterprise auth.

API Keys

Token-based auth for API endpoints with per-key permissions.

IP Allowlist

Restrict access to specific IP ranges or CIDR blocks.

Step 5: Set Up Traffic Policies

Traffic policies let you control how requests flow through your gateway:

  • Rate limiting — per-IP, per-endpoint, or global
  • Request transformation — add/remove headers, rewrite paths
  • Circuit breakers — fail fast when your backend is struggling
  • Geographic blocking — allow or deny by country
  • Load balancing — distribute across multiple agents

Step 6: Multi-Agent Load Balancing & Routing

For production workloads, you can connect multiple agents to the same endpoint. Ngris automatically load-balances traffic across them using configurable strategies (round-robin, least connections, geographic).

Need more control? Routing rules let you direct specific requests to a particular agent based on path, header, cookie, client IP, or HTTP method. This enables blue/green canary deployments, path-based routing (e.g. /api/* to one agent, /web/* to another), and team-specific backends — all from a single hostname.

# On server 1

ngris http 3000 --endpoint api.yourcompany.com

# On server 2

ngris http 3000 --endpoint api.yourcompany.com

# Traffic is now load-balanced between both

Step 7: Monitor and Respond

Every request is logged with full metadata. The traffic inspector shows request/response details in real-time. Anomaly detection alerts you to unusual patterns. And the built-in helpdesk system handles support tickets from your users.

What You Get in Under an Hour

  • Custom domain with auto-renewed TLS certificates
  • A traffic-policy engine with 23 rule types, including a Coraza WAF for OWASP-style attacks
  • Per-endpoint authentication with OAuth providers
  • Traffic policies with rate limiting and geo-blocking
  • Multi-agent load balancing for high availability
  • Real-time traffic inspection and anomaly detection
  • Full audit logging for compliance

Start building your production edge gateway today — create a free account and run your first tunnel in 30 seconds.

Ask an AI to summarise this page
Product
API Gateway Secure Tunnels WAF & Firewall Traffic Inspector
AI
Iris AI AI Gateway
Compare
Ngris vs ngrok Ngris vs Cloudflare Tunnel Ngris vs Vercel Ngris vs Netlify Expose localhost guide
More
Solutions Developers Pricing Enterprise Sign in Get Started Free