apt-get install nginx-full
cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.def
добавляем хост localhost
cp /etc/nginx/sites-available/default /etc/nginx/sites-available/localhost
удаляем симлинк на дефолтную конфигурацию
rm /etc/nginx/sites-enabled/default
активируем наш новый хост
ln -nfs /etc/nginx/sites-available/localhost /etc/nginx/sites-enabled/
Конфиг
server {
listen 80;
listen [::]:80;
root /var/www/j9.loc;
index index.php;
server_name j9.loc;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}