CareerByteCode

Nginx Config Generator (Reverse Proxy, SPA, HTTPS)

For developers and admins putting an app behind Nginx. Pick the site type and options to get server blocks you can paste into sites-available.

FreeRuns in your browserNothing uploadedNo sign-up neededAll 16 tools in the DevOps Toolbox
Keep this resultSign in to email it to yourself or save it to your profile. The tool itself never needs an account.

ByteLabs

Close the gaps with real-world projects

Build industry projects on ByteLabs and add verified proof of your skills to your public profile.

Explore ByteLabs
How to use

How to use the Nginx Config Generator

  1. Enter the domain and pick the site type.
  2. Set the app address for a proxy, or the web root for static, SPA or PHP.
  3. Tick HTTPS, www redirect, gzip, security headers and the rest.
  4. Copy the config, test it with sudo nginx -t and reload Nginx.
Worked example

An example, step by step

You enter

example.com as a reverse proxy to http://127.0.0.1:3000 with HTTPS, www redirect, gzip, security headers and static caching

The tool shows

3 server blocks: port 80 redirecting to HTTPS (keeping the Lets Encrypt challenge path), www.example.com redirecting to example.com, and the HTTPS site with TLS 1.2 and 1.3, security headers, gzip and proxy_pass to the app

FAQ

Questions about the Nginx Config Generator

How do I redirect HTTP to HTTPS in Nginx?

Add a server block on port 80 that returns 301 to https://your-domain$request_uri, as the generated config does, and keep the /.well-known/acme-challenge/ path open for certificate renewals.

How do I serve a React or Vue app with Nginx?

Use try_files $uri $uri/ /index.html so every route falls back to index.html. Pick Single-page app in the generator.

Where do I get the SSL certificate?

Run certbot for your domain first; it creates the files under /etc/letsencrypt/live/your-domain/ that the config points to.

Is the Nginx Config Generator free and private?

Yes. It is free, needs no sign-up and runs entirely in your browser, so what you type is not uploaded. You only sign in if you want to email a result to yourself or save it to your CareerByteCode profile.

Copied