natbox.io

Guides / Host a website

Host a website with nginx and free HTTPS

About 10 minutes. Works on every plan, including the free trial.

Ports 80 and 443 on our shared IPv4 address are used by many servers, so we send each visitor to the right one by domain name. You link the domain once in the client area; after that, a normal web server and certbot work as usual.

  1. Open your server in the client area and go to Domains. Add example.com, and www.example.com as a second domain if you use it.
  2. At your DNS provider add an A record for each name pointing to 5.189.155.145, and the TXT record the tab shows (_natbox and _natbox.www). Remove any other A records for those names.
  3. Add an AAAA record pointing to your server's ::1 address (shown in the Domains and Connect tabs), so IPv6 visitors reach you directly.
  4. Press Verify. New records can take a few minutes to appear.

2. Install nginx

# Debian or Ubuntu
apt update && apt install -y nginx
# Alpine
apk add nginx && rc-update add nginx && rc-service nginx start
# AlmaLinux
dnf install -y nginx && systemctl enable --now nginx

Put your site in /var/www/html (Debian, Ubuntu) or /usr/share/nginx/html (AlmaLinux), then open http://example.com.

3. Get a free HTTPS certificate

# Debian or Ubuntu
apt install -y certbot python3-certbot-nginx
certbot --nginx -d example.com -d www.example.com

List every name you linked. certbot proves the domain over port 80, which reaches your server, and renews the certificate automatically. Your HTTPS traffic is passed through untouched: we never see it or hold your keys.

Visitor IP addresses

IPv6 visitors always arrive with their real address. Over IPv4, plain HTTP requests carry the visitor's address in the X-Forwarded-For header, and HTTPS connections arrive from our router (10.66.0.1). HTTP/3 (QUIC, UDP 443) only works for IPv6 visitors.

If it does not work

Still stuck? Open a ticket, we reply within 24 hours.