Skip to main content
Web Server Tools

Nginx Config Generator

Generate a ready-to-use Nginx server block for a static site, a PHP/Laravel app or a reverse proxy, with optional SSL.

Free & instant No signup How to use FAQ

Always test with nginx -t before reloading, and confirm SSL certificate paths match your actual setup.

Not sure what to enter?

Pick what you are hosting, enter your domain and get an Nginx server block you can paste straight into /etc/nginx/sites-available.

What is an Nginx server block?

A server block is the part of the Nginx configuration that tells it how to answer requests for one domain: which folder or app to serve, whether to use HTTPS and how to handle PHP. This generator writes a clean block for the three most common setups - a static site, a PHP/Laravel app and a reverse proxy to another app.

How to create your Nginx config

  1. Choose the scenario: Static Website, PHP / Laravel or Reverse Proxy.
  2. Enter your domain and the document root, PHP-FPM socket or backend port.
  3. Tick SSL and the HTTP-to-HTTPS redirect if the site has a certificate.
  4. Click Generate, copy the block and save it in your Nginx sites folder, then run nginx -t and reload.

Related checks

After reloading Nginx (sudo nginx -t && sudo systemctl reload nginx), check that the site answers and that HTTPS works with the Website Status Checker and SSL Certificate Checker - and add the site to JustChecker monitoring so you hear about it if a later config change takes it down.

Frequently Asked Questions

On Debian/Ubuntu, save it as /etc/nginx/sites-available/yourdomain.conf, link it into sites-enabled (sudo ln -s ../sites-available/yourdomain.conf /etc/nginx/sites-enabled/), test with sudo nginx -t and reload Nginx. On other systems, files in /etc/nginx/conf.d/ ending in .conf are loaded automatically.

Choose PHP / Laravel. It sends requests to PHP-FPM and falls back to index.php, which is what both WordPress and Laravel expect. Make sure the PHP-FPM socket path matches the PHP version installed on your server.

No. It adds the listen 443 and certificate lines; the certificate itself usually comes from Let's Encrypt (for example with certbot). Once it is installed, the SSL Certificate Checker confirms it is valid and trusted.
Share this tool:
Need a website for your business? Only $599