laravel nginx如何显示目录列表

时间:2019-04-13 09:43:08

标签: php nginx

我在/ var / www / html文件夹中有我的laravel应用。以下是我的nginx conf。

listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;
server_name _;

location / {
    autoindex on;
    try_files $uri /$uri /index.php?$query_string;
}


location ~ \.php$ {
    include snippets/fastcgi-php.conf;
    fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}

问题1)当用户转到example.com/app时,我想向他显示app文件夹的目录内容(该目录包含Http,Console以及其他文件夹和文件)。但它显示了NotFoundHttpException。 try_files首先搜索是否找到了应用程序文件,但没有找到。然后移至/ $ uri,nginx在根文件夹中查找应用程序文件夹。所以它找到了。找到它后为什么不显示内容?

0 个答案:

没有答案