Rules Overview
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
Section titled “How a rule works”A rule pairs a When (matching requests) with a Then (nsin’s action).
The kinds of rules
Section titled “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
Section titled “Create a rule”- Open Rules.
- Click Add Rule.
- Pick the type.
- Set When and Then.
- Click Save.
Scoping
Section titled “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
Section titled “Order matters”Same-type rules run top to bottom, higher first; drag to reorder.
Dry run
Section titled “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
Section titled “On and off”Each rule has a toggle: switch off instead of deleting.
Proxied records
Section titled “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.