root /var/www/laravel-ubuntu/public; index index.php index.html index.htm; # Make site accessible from http://localhost/ server_name localhost;
location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ /index.php?$query_string; # Uncomment to enable naxsi on this location # include /etc/nginx/naxsi.rules } location ~ \.php$ { try_files $uri /index.php =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php7.1-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } **/
这里呢主要是改 fpm 的配置和 nginx 的配置
部署
1 2 3 4 5 6 7 8 9 10 11 12 13
// mkdir /var/www sudo chown -R www-data:www-data /var/www vim .env