nginx-ngx_http_random_index_module

模块简介:在收到以"/"为结尾的请求时,在对应的目录下随机选择一个文件作为index文件。

模块类型:常用标准http模块

使用实例:

        location /privacy_policy/ {
               root /opt/linkface/backend-api/public;
               try_files $uri $uri/ /B-LAP-privacy_policy.html /index.html /index.htm;
        }

这里的应用场景使用try_files,不能使用index。

原文地址:https://www.cnblogs.com/slim-liu/p/9854632.html