Laravel 설치하기
# nginx 설정
sudo vim /etc/nginx/sites-available/default
sudo service nginx reload
# laravel 설치
composer create-project laravel/laravel test
# laravel 설정
cd test
sudo chown www-data storage/ -R
vim .env
server {
listen 80;
root /var/www/test/public;
index index.php;
server_name _;
charset utf-8;
location = /favicon.ico {
access_log off;
log_not_found off;
}
location = /robots.txt {
access_log off;
log_not_found off;
}
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ /\. {
deny all;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
}
}