Nginx Display Long File Name

Nginx Fancy Index module

使用ngx-fancyindex替代audoindex模块。 sudo apt install libnginx-mod-http-fancyindex 编辑/etc/nginx/sites-enabled/default配置文件:

 location / {
              # First attempt to serve request as file, then
              # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ =404;
                #autoindex on;
                #autoindex_localtime on;
                #autoindex_exact_size off;
                fancyindex on;              # Enable fancy indexes.
                fancyindex_exact_size off;  # Output human-readable file sizes.
                fancyindex_localtime on;
                fancyindex_name_length 255;

然后重启nginx服务: sudo systemctl restart nginx