我正试着为我的Laravel项目设立Laradock。我从一个新的laravel项目开始,只是为了测试一些东西,然后再尝试我目前的项目。我遵循了教程,但在步骤中的某个地方,我想我一定是搞砸了什么东西,因为当我浏览URL时,我得到了一个"404 nginx“。以前有人经历过这种情况,或者知道可能出了什么问题?提前感谢!
My example.conf in /var/wwwlaradock/nginx/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项目名为“示例”,位于/var/www中。
发布于 2022-05-31 14:21:39
此错误是由于laradock/nginx/site/中的命名无效造成的。
before: laradock/nginx/sites/domain.laravel
after: laradock/nginx/sites/domain.laravel.conf为我工作!
https://stackoverflow.com/questions/53649263
复制相似问题