nsindocs Search the docs⌘K
  1. Docs
  2. Rules

Rules Overview

What rules are, the fifteen kinds nsin offers, and how scope, order and dry run work.

On this page

Rules tell nsin how to handle requests: redirect, cache, slow attackers, block traffic, or route to another server — at the edge.

Create rules in your domain's Rules section.

How a rule works

A rule pairs a When (matching requests) with a Then (nsin's action).

The kinds of rules

Rule What it does Guide
Redirect Send to a new address. Redirects
URL Rewrite Rewrites the server address invisibly. URL Rewrites
Cache Sets caching, duration, bypasses. Cache Rules
Header Adds, changes or removes headers. Header Rules
Block Blocks by path, host or country. Blocking Traffic
Rate Limit Caps requests per visitor. Rate Limiting
WAF Managed web attack protection. WAF
Challenge Proves a visitor is human. Bots & Challenges
Bots Allows, blocks or reroutes crawlers and AI bots. Bots & Challenges
Fingerprint Matches disguised automated traffic. Bots & Challenges
Origin Pool Multiple servers, health checks, failover. Origins & Failover
Origin Route Routes specific paths to a server. Origins & Failover
Error Page Customizes the error page shown. Custom Error Pages

Two more, no guide yet: Web Optimization (shrinks images/JS/CSS) and Basic Auth (password-protects a path).

Create a rule

  1. Open Rules.
  2. Click Add Rule.
  3. Pick the type.
  4. Set When and Then.
  5. Click Save.

Scoping

Rules narrow three ways, combined:

  • Records — DNS records to cover; empty means whole zone (usual).
  • Hostname — exact host, wildcard (*.example.com), or pattern.
  • Path — includes (/* default) and excludes lists; wildcard or regex, capture groups.

Order matters

Same-type rules run top to bottom, higher first; drag to reorder.

Dry run

Most types save as dry run: nsin logs the match, lets the request through.

Use it for blocks, challenges and filters. Caching ignores dry run.

On and off

Each rule has a toggle: switch off instead of deleting.

Proxied records

Rules only run on traffic reaching the nsin edge; an unproxied record bypasses them. If a rule seems inactive, check this first: Managing DNS Records.

Start with Redirects — the easiest rule to make.

esc