On Static Sites, open Site → Routing → Static Delivery in app.hostedez.com to control how nginx resolves URLs, serves 404 pages, and attaches custom HTTP response headers per path prefix.


URL resolution: SPA fallback & Clean URLs
Toggle SPA fallback and Clean URLs independently depending on your frontend architecture. Hosted EZ compiles your settings directly into nginx’s try_files directive:
| SPA Fallback | Clean URLs | Resulting nginx try_files |
Recommended For |
|---|---|---|---|
| Off | Off | $uri $uri/ =404 |
Plain HTML sites with explicit .html links or /dir/index.html folders |
| Off | On | $uri $uri.html $uri/ =404 |
Astro, Next.js static export, Hugo, Eleventy (extensionless URLs + real 404s) |
| On | Off | $uri $uri/ /index.html |
React, Vite, Vue, Svelte SPAs using browser history routing |
| On | On | $uri $uri.html $uri/ /index.html |
Hybrid apps with pre-rendered .html marketing pages plus a client-side SPA fallback |
Custom 404 page
Set Custom 404 page to a site-relative HTML file inside public_html, such as /404.html or /errors/404.html.
Validation rules:
- Must start with
/and end with.htmlor.htm. - Maximum length:
256bytes. - Must not point to
/itself, contain..path traversal, or reference hidden dotfiles/directories. - Leave empty to use the default nginx
404response.
Custom Response Headers
Define path-prefix header rules to customize caching, security policies, CORS, and crawler directives without managing server config files.
Limits & matching rules
- Maximum rules per site:
25unique path prefixes (for example,/,/assets,/_astro,/embed). - Maximum headers per rule:
10headers. - Maximum header value length:
1,024bytes (printable ASCII only;",\,$,{`, and `}are rejected to prevent config injection; semicolons;and single quotes'are allowed for CSP and Cache-Control). - Precedence & inheritance: Rules are evaluated longest path prefix first and merged with the root
/rule—a header defined on/assetsoverrides the same header on/, while other headers from/(such asReferrer-PolicyorX-Frame-Options) continue to apply. - Platform-managed transport headers: Hosted EZ always attaches
Strict-Transport-Security: max-age=31536000; includeSubDomains,Alt-Svc: h3=":443"; ma=86400(on HTTPS), andX-Content-Type-Options: nosniffautomatically—you do not need to add them yourself.
All 15 allowlisted response headers
| Category | Header Name | Typical Use |
|---|---|---|
| Caching | Cache-Control |
Immutable caching for hashed bundles, no-cache for HTML |
| Security | Content-Security-Policy |
Restrict script, style, image, and frame origins |
| Security | Content-Security-Policy-Report-Only |
Test a CSP policy before enforcing it |
| Security | X-Frame-Options |
Prevent clickjacking (DENY or SAMEORIGIN) |
| Security | Referrer-Policy |
Control Referer header leakage |
| Security | Permissions-Policy |
Disable unused browser APIs (camera, microphone, geolocation) |
| Isolation | Cross-Origin-Opener-Policy |
Enable cross-origin isolation (same-origin) |
| Isolation | Cross-Origin-Embedder-Policy |
Pair with COOP for SharedArrayBuffer / WebAssembly (require-corp) |
| Isolation | Cross-Origin-Resource-Policy |
Restrict cross-origin asset loading (same-origin or cross-origin) |
| CORS | Access-Control-Allow-Origin |
Allow cross-origin fetches (fonts, JSON data, embeds) |
| CORS | Access-Control-Allow-Methods |
Permitted HTTP methods (GET, HEAD, OPTIONS) |
| CORS | Access-Control-Allow-Headers |
Permitted request headers |
| CORS | Access-Control-Expose-Headers |
Response headers readable by browser JS |
| CORS | Access-Control-Max-Age |
Preflight cache TTL in seconds |
| Crawlers | X-Robots-Tag |
Prevent indexing of staging/internal paths (noindex, nofollow) |
Copy-paste header recipes
Rule 1 — Path prefix /:
Cache-Control:no-cache, must-revalidateX-Frame-Options:DENYReferrer-Policy:strict-origin-when-cross-originPermissions-Policy:camera=(), microphone=(), geolocation=()
Rule 2 — Path prefix /assets:
Cache-Control:public, max-age=31536000, immutable
Rule 1 — Path prefix /:
Cache-Control:no-cache, must-revalidateX-Frame-Options:SAMEORIGINReferrer-Policy:strict-origin-when-cross-origin
Rule 2 — Path prefix /_astro (or /_next/static for Next.js):
Cache-Control:public, max-age=31536000, immutable
Rule — Path prefix /fonts (or /data):
Access-Control-Allow-Origin:*Access-Control-Allow-Methods:GET, HEAD, OPTIONSCross-Origin-Resource-Policy:cross-originCache-Control:public, max-age=31536000, immutable
Rule — Path prefix /:
Content-Security-Policy:default-src 'self'; img-src 'self' https: data:; style-src 'self' 'unsafe-inline'; script-src 'self'; frame-ancestors 'none'
Verify active headers with curl
After saving your rules, verify the live response headers:
curl -sI https://docs.example.com/ | grep -iE '^(http|cache-control|x-frame-options|referrer-policy|content-security-policy)'
curl -sI https://docs.example.com/assets/index-abc123.js | grep -iE '^(http|cache-control)'