sudo apt install nginx
sudo systemctl stop nginx
sudo systemctl start nginx
sudo systemctl restart nginx
sudo systemctl reload nginx
By default, Nginx is configured to start automatically when the server boots. If this is not what you want, you can disable this behavior by typing:
sudo systemctl disable nginx
To re-enable the service to start up at boot, you can type:
sudo systemctl enable nginx
sudo apt install php7.2-fpm
Nginx utilise une socket pour accéder à PHP.
sudo vim /etc/php/7.2/fpm/pool.d/www.conf
Check listen = /var/run/php/php7.2-fpm.sock
have the right socket path.
Dans la configuration de site PHP (/etc/nginx/sites-available/default) il faut vérifier que l'adresse de la socket est correcte :
location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php/php7.2-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }