要配置nginx,如下所示
location ~ "^/[A-Z0-9]{32}" {
alias /opt/eds/web/html;
index index.html index.htm;
}
nginx异常日志
`2019/12/17 23:22:56 [error] 28874#28874: *4 directory index of "/opt/eds/web/html" is forbidden`
但按如下所示修改nginx配置
location /25DE5ADF310211E9BDB874D435BEC0BA {
alias /opt/eds/web/html;
index index.html index.htm;
}
访问没有问题
答案 0 :(得分:0)
将alias
与正则表达式location
一起使用时,您需要捕获URI的其余部分并将其附加在alias
值上。
例如:
location ~ "^/[A-Z0-9]{32}(/.*)?$" {
alias /opt/eds/web/html$1;
index index.html index.htm;
}
有关详细信息,请参见this document。