我正在尝试为我的Laravel项目设置Laradock。我从一个新的laravel项目开始,目的是在尝试当前项目之前先进行测试。 我遵循了该教程,但是在执行步骤的某个地方,我一定搞砸了一些东西,因为当我浏览URL时,我得到的是“ 404 not found nginx”。有人以前经历过此事,或知道可能出什么问题了吗?预先感谢!
我在/ var / wwwlaradock / nginx / sites中的example.conf
server {
listen 80;
listen [::]:80;
server_name example.local;
root /var/www/example/public;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_pass php-upstream;
fastcgi_index index.php;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
location /.well-known/acme-challenge/ {
root /var/www/letsencrypt/;
log_not_found off;
}
error_log /var/log/nginx/laravel_error.log;
access_log /var/log/nginx/laravel_access.log;
}
我的主机文件
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
127.0.0.1 example.local
我的laravel项目的名称为“ example”,位于 / var / www