Welcome! Log In Create A New Profile

Advanced

Re: забыл слэш в конце url получил сусанин-autoindex

May 10, 2015 05:39AM
РЕШЕНО.
Решил проблемку с относительными путями в body autoindex заменяя их полными URI.
Тем самым привожу ссылки к однозначному толкованию в браузерах.
Написал обработчик body на lua.
https://github.com/itcod/md5index
Может кому пригодится кроме меня:)

Заодно добавил обработчику функционала: умеет добавлять контрольные суммы/хэши файлов и иконки по расширениям, и указывает тип. Внутри body добавляет <!-- --> для возможности автоматического парсинга данных на странице из JS

Nginx addon for function autoindex.
Add in body html:
1. HASH code files. Support secure hash: md5 md4 sha1 sha ripemd160;
2. Rewrite relative path body html to full URI path for files;
3. Add extension icons for folders and files. Require icons lib.
Example icons lib 16x16: http://ihome.itcod.com/max/projects/libs/icons16/
Test computation in Lua (5.1)

---
set $md5index on; #on/off nil=off # вкл/выкл обработчик
set $md5index_hash md5; #none/md5/md4/sha1/sha/ripemd160 nil=none # тип выводых хэшей
set $md5index_size 50000; #kb nil=unlimit # не считать для файлов более N kb
set $md5index_path on; #on/off nil=off # заменять относительный путь ссылок на полный URI
set $md5index_nonblank on; #on/off nil=off # заменить множественные пробелы одним
set $md5index_type on; #on/off nil=off # добавит в строки описание типа file/directory/etc...
set $md5index_ico http://ihome.itcod.com/max/projects/libs/icons16/; # путь к библиотека иконок
set $md5index_icopref icon-; # префикс имени файла иконки
#set $md5index_icosuf -icon; # суфикс имени файла иконки
set $md5index_icoext .gif; # расширение файла иконки
body_filter_by_lua_file /etc/nginx/lua/md5index.lua; # addon обработчик
Subject Author Posted

забыл слэш в конце url получил сусанин-autoindex

itcod April 23, 2015 03:18PM

Re: забыл слэш в конце url получил сусанин-autoindex

Валентин Бартенев April 23, 2015 03:42PM

Re: забыл слэш в конце url получил сусанин-autoindex

itcod April 24, 2015 03:11AM

Re: забыл слэш в конце url получил сусанин-autoindex

itcod April 24, 2015 03:24AM

Re: забыл слэш в конце url получил сусанин-autoindex

itcod May 10, 2015 05:39AM

Re: забыл слэш в конце url получил сусанин-autoindex

Илья Шипицин May 12, 2015 03:34PM

Re: забыл слэш в конце url получил сусанин-autoindex

itcod July 14, 2015 05:31PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 285
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready