DOCUMENTATION

Static hosting
with Nginx.

A minimal configuration and a few HTTP checks you can run against your own deployment.

Quickstart

Create /var/www/static-demo/index.html, then load the sample as an Nginx server block. It listens locally on port 8080.

nginx.conf · server blockDownload ↓
server {
    listen 127.0.0.1:8080;
    root /var/www/static-demo;
    index index.html;

    location / {
        try_files $uri $uri/ =404;
    }
}

With the block included under http, run sudo nginx -t before reloading Nginx. Then request the page with curl -i http://127.0.0.1:8080/.

HTTPS and HTTP/2

For a public site, point DNS at your server and install a certificate for the hostname. Use a client with HTTP/2 support to inspect the negotiated version.

curl · HTTPS
curl -I --http2 https://portal.neon-static.com/

Cache validation

Save the validator from a first request and send it back with the second one. When the file is unchanged and the validator matches, the origin can return 304 Not Modified.

curl · conditional GET
url=https://portal.neon-static.com/examples/manifest.json
curl -fsS --etag-save neon-static.etag "$url"
curl -isS --etag-compare neon-static.etag "$url"

Health checks

Check the response status and body. A successful response confirms the origin handled the request at that moment.

curl · origin health
curl -fsS https://portal.neon-static.com/healthz

Open the live inspector →