This solution is a complete, single-file HTML application. It features a premium, responsive UI, real-time validation logic, and a clear, functional interface for Nginx location block testing. ```html Free Nginx Location Block Regex Tester & Validator

Nginx Location Block Regex Tester

Validate your Nginx configuration logic in real-time. Test how your location blocks handle incoming request URIs without server restarts.

Results

Enter a pattern and test URL to see validation results.

Nginx Location Priority Reference

Nginx evaluates locations in this order of precedence:

  1. = (Exact Match): The highest priority. If found, processing stops immediately.
  2. ^~ (Non-Regex Prefix): If the longest prefix match is found with this flag, regex matches are not checked.
  3. ~ / ~* (Regex): Evaluated in the order they appear in the configuration file.
  4. Prefix Match: If no other match is found, the longest non-regex prefix match is used.