nginx is configured and running

This server is alive. The next step is to add your application or to deploy your site files in the document root.

The placeholder you see here is what nginx returns when no other site matches the request.

Document root

The default location is /usr/share/nginx/html. Replace index.html with your own.

Add a virtual host

  1. Create a file in /etc/nginx/conf.d/ ending with .conf.
  2. Define a server { ... } block with listen 80; and server_name yourdomain.tld;.
  3. Point root at the directory holding your site files.
  4. Run sudo nginx -t to test the configuration.
  5. Reload: sudo systemctl reload nginx.

HTTPS

Issue a certificate with your favourite ACME client and add the listen 443 ssl; directives to your server block. Most setups also enable HTTP/2 by appending http2 on the same line.

Common tuning knobs

Diagnostics

If something does not behave, the first place to look is /var/log/nginx/error.log. Most issues are logged there with the request URI and a reason code.

node-7.fra1.example.net