Developer Utilities

How to Generate an Nginx Server Block Configuration

Step-by-step guide to generating an nginx config for a static site, Node.js app, or reverse proxy with SSL using the DevHexLab Nginx Config Generator.

Tool Used

Nginx Config Generator

Open tool
1

Open the Nginx Config Generator

Navigate to /tools/developer/nginx-config-generator.

2

Enter your domain and site type

Type your domain name (e.g. example.com) and select the site type: Static, Node.js / Reverse Proxy, PHP-FPM, or Python/Gunicorn. The generator adjusts the config template accordingly.

3

Configure SSL and options

Enable SSL to add Let's Encrypt certificate paths and HTTPS redirect rules. Toggle gzip compression, security headers, and www-to-non-www redirect as needed.

4

Copy and deploy the config

Click Copy to copy the nginx config. Paste it into /etc/nginx/sites-available/yourdomain.conf, create a symlink to sites-enabled, then run nginx -t to validate before reloading with systemctl reload nginx.

All done!

You are ready to use Nginx Config Generator like a pro.

Try it now
All guides