Create a ready Nginx server block: WordPress with PHP-FPM, a proxy for Node or Python apps, or a static site, with HTTPS, www redirects, compression, caching and security headers.
Point the domain A record to the server before issuing the certificate
Check the PHP-FPM socket name in /run/php/
Avoid
Editing the main nginx.conf for each site; give each site its own file
Exposing the app port to the world; the proxy is enough
Example: WordPress on a new VPS
After preparing the server with the VPS setup script, install Nginx, PHP-FPM and a database, then create the config here with the WordPress type. Put the file in /etc/nginx/sites-available, enable it, run nginx -t then reload, and issue the certificate with the certbot command shown below the config.
Key terms
Short definitions of what you meet along the way.
Server block
A section of Nginx config defining one site and its domain.
PHP-FPM
The service that runs PHP files; Nginx passes requests to it.
Reverse proxy
Nginx receives visitors and forwards requests to an app on an internal port.
We use necessary cookies to run the site, and Google Analytics to measure visits only if you agree. You can change your choice at any time from “Cookie settings”. Privacy policy