Install it
- Save it as
/etc/nginx/sites-available/example.comand link it intosites-enabled. - Get a certificate:
sudo certbot certonly --nginx -d example.com -d www.example.com. - Test and reload:
sudo nginx -t && sudo systemctl reload nginx.
Frequently asked questions
Which PHP socket path should I use?
Check /run/php/ — it is usually php8.x-fpm.sock matching your PHP version.
Does it support WebSockets in proxy mode?
Yes, Upgrade and Connection headers are included.
Is it safe to use as-is?
It follows common best practice, but always run nginx -t before reloading.

