Static site generators like Astro, Next.js (static export), Hugo, Eleventy, and Docusaurus pre-render every route into .html files at build time. Hosted EZ’s Static Site runtime serves them directly from nginx with Clean URLs, Custom 404 pages, and path-prefix response headers.
Framework build configuration
Astro defaults to static output (output: 'static') and writes files to dist/. Set your production site URL in astro.config.mjs:
import { defineConfig } from "astro/config";
export default defineConfig({
site: "https://docs.example.com",
output: "static",
build: {
format: "directory", // generates /about/index.html
},
});Create a custom 404 page at src/pages/404.astro so Astro emits dist/404.html.
Build and package:
npm ci
npm run build
zip -r dist.zip dist/Enable static export in next.config.ts (or next.config.mjs) and set images.unoptimized: true (since the built-in Next.js Image Optimization API requires a Node server):
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
output: "export",
images: {
unoptimized: true,
},
};
export default nextConfig;Create app/not-found.tsx (App Router) or pages/404.tsx (Pages Router) so Next.js emits out/404.html.
Build and package:
npm ci
npm run build
zip -r out.zip out/Both Hugo (public/) and Eleventy (_site/) generate static HTML directories ready to archive:
# Hugo
hugo --minify
zip -r site.zip public/
# Eleventy
npx @11ty/eleventy
zip -r site.zip _site/Configure Clean URLs, Custom 404 & Headers
- Create a Static Site in app.hostedez.com and upload your
.zipor.tar.gzarchive in the Deployments tab. - Open Site → Routing → Static Delivery:
- Clean URLs: turn On so
/pricingresolves/pricing.htmlor/pricing/index.htmlautomatically (try_files $uri $uri.html $uri/ =404;). - SPA fallback: leave Off so genuinely missing URLs return a proper HTTP
404status (better for SEO). - Custom 404 page: enter
/404.html(must end with.htmlor.htm).
- Clean URLs: turn On so


Recommended Custom Response Headers
Add path-prefix rules in Routing → Static Delivery → Custom Response Headers so hashed framework bundles cache aggressively while HTML documents revalidate on every deploy:
| Path Prefix | Header | Value |
|---|---|---|
/ |
Cache-Control |
no-cache, must-revalidate |
/ |
Referrer-Policy |
strict-origin-when-cross-origin |
/ |
X-Frame-Options |
SAMEORIGIN |
/_astro |
Cache-Control |
public, max-age=31536000, immutable |
| Path Prefix | Header | Value |
|---|---|---|
/ |
Cache-Control |
no-cache, must-revalidate |
/ |
Referrer-Policy |
strict-origin-when-cross-origin |
/ |
X-Frame-Options |
SAMEORIGIN |
/_next/static |
Cache-Control |
public, max-age=31536000, immutable |
Next steps
- Automate builds and deployments on every push with SFTP & GitHub Actions CI/CD.
- Add permanent
301/308redirects for moved pages in Redirects, Password Protection & Maintenance Mode. - Review all 15 allowlisted custom headers in SPA Routing, Clean URLs & Custom Headers.