Every Hosted EZ site—both Static Sites and PHP/CMS sites—includes nginx-enforced Redirects, Password-Protected Directories, and Maintenance Mode under Site → Routing in app.hostedez.com. Because nginx evaluates these rules before PHP or static file handlers run, they add zero application overhead.
Evaluation precedence order
When a request arrives at your site, nginx evaluates routing features in this exact order:
- ACME TLS validation (
/.well-known/acme-challenge/) — always allowed so certificate renewals never break, even during Maintenance Mode or site-wide password protection. - Maintenance Mode — returns HTTP
503for all visitors whose IP is not in the bypass list. - HTTP Redirects —
exactmatch rules are checked first, followed byprefixrules (longest prefix first), and finally a root/prefix redirect if configured. Redirects bypass HTTP Basic Auth. - Password-Protected Directories — enforces HTTP Basic Auth on matching paths (blocking direct static asset access under protected paths as well).
- Static Delivery / Application — serves static files (with custom headers/SPA fallback/clean URLs) or proxies to Apache/PHP-FPM.
HTTP Redirects
Open Site → Routing → Redirects to manage up to 100 redirect rules per site.
Supported options
- Source path: site-relative path starting with
/(max512bytes; trailing slash is normalized;/.well-known/acme-challengeis reserved). - Match type:
exact: matches only the exact path (for example,/old-pricing→/pricing).prefix: matches the path and everything beneath it, preserving the trailing path suffix onto the target URL (for example,/blog→https://news.example.com/postsredirects/blog/launchtohttps://news.example.com/posts/launch).
- Target URL: either a site-relative path starting with
/or a fullhttp:///https://URL (max2,048bytes). - Status code:
301— Moved Permanently (recommended for SEO migrations; cached by browsers)302— Found (Temporary redirect)307— Temporary Redirect (preserves HTTP method and request body, e.g.POST)308— Permanent Redirect (preserves HTTP method and request body)
- Preserve query string: appends the incoming query string (
?utm_source=...) to the destination URL (merging cleanly with&if the target URL already contains a query string). - Enabled toggle: disable a rule temporarily without deleting it.
Password-Protected Directories (HTTP Basic Auth)
Open Site → Routing → Password protection to lock down / (your entire site) or specific subpaths (such as /staging, /admin, or /internal-docs) with HTTP Basic Auth.
Limits & security behavior
- Maximum rules per site:
25unique paths. - Realm:
1–64printable ASCII characters (displayed in the browser’s sign-in prompt; defaultRestricted Area). - Username:
1–64characters matching^[A-Za-z0-9._-]{1,64}$. - Password:
8–72UTF-8 bytes; stored exclusively as a bcrypt hash (plaintext passwords are never persisted or echoed). - Automatic cache safety: Any response served under a password-protected path automatically sets
Cache-Control: private, no-storeso shared proxies and CDNs never cache private pages or assets. - Static asset protection: Subpath Basic Auth rules use nginx prefix matching (
^~) so direct requests to/private/report.pdfor/private/app.jscannot bypass authentication.
Maintenance Mode
Open Site → Routing → Maintenance to display a branded HTTP 503 Service Unavailable page while performing major deployments, database imports, or content updates.
Features & limits
- HTTP status & headers: Responds with HTTP
503,Retry-After: 300,Cache-Control: no-store, no-cache, must-revalidate, andCDN-Cache-Control: no-storeso search engines do not de-index your pages and caches do not store the maintenance notice. - Custom Title: up to
120characters (default:Site under maintenance). - Custom Message: up to
500characters (default:We are performing scheduled maintenance and will be back shortly.). - Bypass IPs / CIDRs: up to
20IPv4/IPv6 addresses or CIDR blocks (for example,203.0.113.42or198.51.100.0/24). Requests from allowlisted IPs bypass the503page and see the live site normally so you can verify changes before disabling Maintenance Mode. - Zero disruption to TLS:
/.well-known/acme-challenge/automatically bypasses Maintenance Mode.
Testing routing rules from the CLI
# Inspect redirect status and Location header without following
curl -sI https://example.com/old-page | grep -iE '^(http|location)'
# Test a password-protected directory (expects 401 without creds, 200 with creds)
curl -sI https://example.com/private/
curl -sI -u "reviewer:your-password" https://example.com/private/
# Verify Maintenance Mode headers (expects 503 + Retry-After: 300)
curl -sI https://example.com/ | grep -iE '^(http|retry-after|cache-control|cdn-cache-control)'