sudo systemctl disable apache2
sudo apt-get install nginx
sudo mv /etc/nginx/sites-available/default /etc/nginx/sites-available/default.org
vi /etc/nginx/sites-available/default
server {
listen 80;
listen [::]:80;
root /var/www/html;
index index.php index.html index.htm;
server_name 127.0.0.1;
client_max_body_size 100M;
autoindex off;
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;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
sudo systemctl restart nginx.service
コメント