Key Features
Simplified Configuration
Instead of writing Nginx configuration directly, use YAML-based routing rules that are automatically translated into optimized Nginx configs. Focus on what your app needs, not how to configure a web server.Smart Default Routing
Out of the box, the Static service handles common patterns for modern web applications:- Try exact path (
/about→/about) - Try with HTML extension (
/about→/about.html) - Try directory index (
/docs→/docs/index.html) - Fall back to SPA routing (
/app/route→/index.html) - Return 404 if nothing matches
Single Page Applications work without any configuration. The automatic fallback to
/index.html ensures client-side routing works correctly.Advanced Routing Features
- Masked redirects: Show content from another URL while keeping the original URL
- Wildcard patterns: Handle multiple routes with a single rule
- Domain management: Redirect between multiple domains
- Path preservation: Keep paths when redirecting
- Query preservation: Maintain query parameters across redirects
Built-in CORS Support
Enable CORS with a single configuration line. No need to understand Nginx’sadd_header directives.
Custom Headers
Add security headers, cache control, or any custom headers with simple YAML configuration.SEO Optimization
Integrated Prerender.io support ensures search engines, social media crawlers, and AI tools can properly index your content.When to Use Static Service
Perfect For:
- Single Page Applications (React, Vue, Angular, Svelte)
- Static site generators (Gatsby, Next.js static export, Nuxt static)
- Documentation sites (Docusaurus, VitePress, MkDocs)
- Landing pages and marketing sites
- Simple static websites
Consider Full Nginx If:
- You need complete control over Nginx configuration
- You have complex server-side logic requirements
- You need custom Nginx modules
- You want to use advanced Nginx features not exposed by the Static service
Basic Configuration
Minimalzerops.yaml for a static service:
- Optimized Nginx server
- SPA-friendly routing
- Alpine Linux base
- Automatic scaling
Routing Configuration
Simple Redirects
Domain Management
CORS Configuration
Custom Headers
Framework Integration
The Static service works with any framework that generates static files:- React: Deploy
build/ordist/ - Vue: Deploy
dist/ - Angular: Deploy
dist/<project-name>/ - Svelte: Deploy
build/ordist/ - Next.js: Deploy
.next/(static export) - Nuxt: Deploy
.output/public/ - Gatsby: Deploy
public/
SEO with Prerender
Enable Prerender.io to make your SPA SEO-friendly:- Set the
PRERENDER_TOKENsecret variable in Zerops GUI - Optionally configure custom host:
Prerender automatically detects crawlers (including AI tools like ChatGPT, Perplexity, and Claude) and serves them pre-rendered HTML while users get the full interactive experience.
Migration to Full Nginx
If you need more control, you can migrate to a full Nginx service:- Go to your Static service in Zerops GUI
- Click the three dots (⋮) in the left panel
- Select Need to switch to full Nginx service?
- Copy the generated Nginx configuration
- Use it as a starting point for a full Nginx service
Comparison: Static vs Nginx
| Feature | Static Service | Full Nginx |
|---|---|---|
| Configuration | YAML-based, simplified | Full Nginx config files |
| SPA Support | Built-in, no config needed | Manual configuration required |
| Redirects | Simple YAML rules | Nginx rewrite directives |
| CORS | One-line configuration | Manual header configuration |
| Custom Headers | YAML configuration | Nginx add_header directives |
| Prerender.io | Built-in support | Manual configuration |
| Flexibility | Limited to exposed features | Complete control |
| Learning Curve | Low | Requires Nginx knowledge |
Next Steps
Quickstart
Deploy your first static site
Routing Guide
Learn advanced routing patterns
SEO Optimization
Set up Prerender.io
Framework Examples
See framework-specific examples