🔀
NGINX LOCATION ROUTING & PROXY PASS SIMULATOR
Mathematically resolves which location block wins and how proxy_pass mutates upstream URLs
Incoming Request URI
the simulated HTTP request path
GET
Location Blocks 0
Modifier + Pattern proxy_pass destination
⌘/Ctrl+↵
Simulation Results
Click ▶ SIMULATE ROUTING above to run the simulation.
⬆ Import nginx Config — Parse location blocks from config text

Paste a nginx server { } block or a list of location directives. Location blocks will be parsed and loaded automatically.

⚡ Batch URI Test — Test Multiple Paths At Once

Enter one URI per line. Each will be matched against the current location blocks.

📋 Export as nginx Config Snippet

Generates a ready-to-paste nginx server { } block from your current location blocks.

NGINX Location Priority Reference
Priority Modifier Behavior
1st = Exact match. If the full URI matches exactly, this block wins immediately. NGINX stops searching.
2nd ^~ Preferential prefix. Among all prefix matches, if the longest one uses ^~, NGINX wins this block and skips regex evaluation entirely.
3rd ~ / ~* Regex (case-sensitive / case-insensitive). Evaluated in declaration order. The FIRST matching regex wins. Halts further evaluation.
4th (none) Standard prefix. The longest matching prefix wins, but only if no regex matched first. Regex is always tried before fallback to this.
ℹ proxy_pass mutation: If proxy_pass has a URI component (including a bare trailing slash), NGINX strips the matched location prefix from the request URI and appends the remainder to the proxy_pass URI. If proxy_pass has NO URI (just host:port), the full original URI is forwarded unchanged. Regex locations cannot use URI substitution — the full URI is always forwarded.
Share MySysAd

⚠️ IMPORTANT DISCLAIMER: The tools and scripts on this site are provided "AS IS" for educational purposes.

Review destructive commands before executing. By using this site, you assume all risk and agree to our Full Terms of Service.