1、在nginx.conf内配置增加如下配置
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location /excel {
alias /home/excel;
autoindex on; #开启索引功能
autoindex_exact_size off; # 关闭计算文件确切大小(单位bytes),只显示大概大小(单位kb、mb、gb)
autoindex_localtime on; # 显示本机时间而非 GMT 时间
}
复制代码
2、访问地址是:域名/excel
例如:http://192.168.22.57:811/excel
3、其他说明:
若不想列表所有列表可以选择关闭索引功能
#autoindex on; #开启索引功能
复制代码
关于下面这一行配置的详细说明,推荐看一下这篇文章,写的蛮详细的
location / {
try_files $uri $uri/ /index.php?$query_string;
}
复制代码