Добрый день уважаемые!
Выставляю на Ваш суд свою поделку. Просьба сильно не пинать:) Конечно ещё
сыровата... но я уже кушаю:)))
Просто не нашёл аналогичного... может плохо искал.... вот и пришлось
покодить немножко. Надеюсь полезная будет:)
Сервис "ITCOD-DISK" Облачное хранилище.
-- Copyright (c) 2015 by Yura Vdovytchenko (max(a)itcod.com)
-- Copyright (c)itcod 2010-2015
-- version: 15.06.27
-- license: MIT
Назначение: Сетевой диск(хранилище) файлов по технологии WEBDAV.
С публикацией по http/https и индексный файл с контрольными суммами
md5/etc.
Предназначен для хранения и публикации NoSQL информационных массивов.
Принцип: Сервис-ориентированная архитектура построения. Nginx обеспечивает
стандартный протокол WEBDAV over HTTP/HTTPS. Lua-модули itcod обеспечивают
расширение функций и сетевые сервисы управления ITCOD-DISK'ом.
ITCOD UI WWII обеспечивает WEB-интерфейс между пользователем и сервисами.
ОТЛИЧИЕ ОТ АНАЛОГОВ
NoLAMP NoLEMP NoSQL SOA
На сервере только Nginx + Lua и никаких PHP SQL и т.д.
БАЗОВЫЕ КОМПОНЕНТЫ ITCOD-DISK
LINUX - операционная система
NGINX - http daemod (with WebDAV and Lua)
LUA - язык программирования
Resty - библиотека Lua
add - дополнительные библиотеки (см. require в *.lua)
ITCOD Lua Modules & Services - модули SOA ITCOD для операций с хранилищем
ITCOD WWII - web-интерфейс для ITCOD-DISK (в разработке)
БАЗОВЫЕ КОМПОНЕНТЫ ITCOD Lua Modules & Services
auth-dav.lua - авторизатор для HTTP/HTTPS/WEBDAV
md5index.lua - расширитель функций autoindex NGINX
itcod-user.lua - создание пользовательских юзербоксов на диске WEBDAV
itcod-exchange.lua - сервис транспорта файлов между пользователями и
дисками
itcod-search.lua - REST-сервис авторизованного поиска информации в закрытых
пользовательских массивах
libs/ - библиотека иконок типов файлов для md5index
Подробнее о компанентах см. https://ihome.itcod.com/max/project/
КОНФИГУРАЦИЯ NGINX
nginx version: nginx/1.7.11
built by gcc 4.4.4 20100630 (Red Hat 4.4.4-10) (GCC)
TLS SNI support enabled
configure arguments:
--prefix=/usr/share/nginx
--sbin-path=/usr/sbin/nginx
--conf-path=/etc/nginx/nginx.conf
--error-log-path=/var/log/nginx/error.log
--http-log-path=/var/log/nginx/access.log
--http-client-body-temp-path=/var/lib/nginx/tmp/client_body
--http-proxy-temp-path=/var/lib/nginx/tmp/proxy
--http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi
--http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi
--http-scgi-temp-path=/var/lib/nginx/tmp/scgi
--pid-path=/run/nginx.pid
--lock-path=/run/lock/subsys/nginx
--user=nginx
--group=nginx
--with-pcre-jit
--with-debug
--with-file-aio
--with-ipv6
--with-http_ssl_module
--with-http_realip_module
--with-http_addition_module
--with-http_xslt_module
--with-http_image_filter_module
--with-http_geoip_module
--with-http_sub_module
--with-http_dav_module
--add-module=/usr/src/nginx-dav-ext-module-master
--with-http_flv_module
--add-module=/usr/src/f4f-hds-master
--with-http_mp4_module
--with-http_gzip_static_module
--with-http_random_index_module
--with-http_secure_link_module
--with-http_degradation_module
--with-http_stub_status_module
--with-http_perl_module --with-mail
--with-mail_ssl_module
--with-http_auth_request_module
--add-module=/usr/src/echo-nginx-module-master
--add-module=/usr/src/nginx_md5_filter-master
--add-module=/usr/src/ngx_devel_kit-master
--add-module=/usr/src/lua-nginx-module-master
--with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector
--param=ssp-buffer-size=4 -m64 -mtune=generic'
--with-ld-opt=' -Wl,-E,-rpath,/usr/local/lib'
КОНФИГУРАЦИЯ ВИРТУАЛЬНОГО WEB-СЕРВЕРА (WEBDAV)
Приведена конфигурация nginx работающего на виртуальной машине
за проксирующим первичным nginx. Для работы на первичном вам необходимо
изменить listen на 80 и 443. А так же не забудьте поправить основные
настройки на ваши собственные (имена сервера и т.д.)
Файл ihome.conf
server {
listen 7070;
server_name "~^ihome\d+\.itcod\.com$"
ihome.virtual.ko
ihome.itcod.com
;
server_name_in_redirect off;
expires epoch;
ssl off;
#default_type application/octet-stream;
set_real_ip_from 10.255.255.7;
real_ip_header X-Forwarded-For;
real_ip_recursive on;
access_log /var/log/nginx/ihome.itcod.com-access.log main;
resolver 10.255.255.1 [::1]:5353;
charset utf-8;
set $dir /opt/home;
set $testdir $dir$uri;
set $uri_type none;
if (-d $testdir) { # такая папка есть
set $uri_type dir;
rewrite ^(.*)$ $1/;
rewrite ^(.*)/+$ $1/;
}
if (-f $testdir) { # такой файл есть
set $uri_type file;
}
if ($request_method = "MKCOL") {
rewrite ^(.*)$ $1/;
rewrite ^(.*)/+$ $1/;
set $uri_type dir; #клиент webdav создает папку
}
if ($request_method = "PUT") {
set $uri_type file; #передаем только файлы
}
if ($request_method = "POST") {
set $uri_type file; #постим только файлы
}
set $sadm_passwd .uhtpsw;
set $user_passwd .htpasswd; #user:password[crypt(3)/md5/sha1]
set $user_permit .htpermit; #user:GET,PUT,....OPTIONS
set $user_permit_default GET,PROPFIND,OPTIONS; # Allow
merge_slashes on;
location / {
limit_req zone=itcod burst=200 nodelay;
limit_rate 2048k;
access_by_lua_file /etc/nginx/lua/auth-dav.lua;
dav_methods PUT DELETE MKCOL COPY MOVE;
dav_ext_methods PROPFIND OPTIONS;
create_full_put_path on;
dav_access user:rw group:rw;
client_body_temp_path /opt/itcod-dav.tmp/;
client_max_body_size 0;
autoindex on;
root $dir;
header_filter_by_lua_file /etc/nginx/lua/itcod-exchange.lua;
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/icons16ext/; #
путь к библиотека иконок
set $md5index_icopref icon-; # префикс имени файла иконки
#set $md5index_icosuf -icon; # суфикс имени файла иконки
set $md5index_icoext .gif; # расширение файла иконки
set $md5index_win _blank; # target window for !winext! files
set $md5index_winext htm.html.txt; # file extension for target windows
body_filter_by_lua_file /etc/nginx/lua/md5index.lua; # addon
обработчик
}
location ~/\.uht {
deny all;
}
location /search/ {
content_by_lua_file /etc/nginx/lua/itcod-search.lua;
}
location /user/ {
content_by_lua_file /etc/nginx/lua/itcod-user.lua;
}
}
ПРИМЕЧАНИЕ
Для программистов адекватных perl, проблем определить и загрузить
недостающие
модули require не составит труда. В случае если у вас, что то не получается
пишите тут или на max(a)itcod.com обязательно помогу.
ТЕКУЩИЕ РАБОТЫ
Формирование WebUI ITCOD-DISK
Posted at Nginx Forum: http://forum.nginx.org/read.php?21,259941,259941#msg-259941
Здравствуйте!
У меня наверное быстро решимая
проблема, но я просто решение вопроса
не вижу.
Работает у меня nginx 1.0.8
--------
nginx: nginx version: nginx/1.0.8
nginx: configure arguments: --with-http_gzip_static_module
--with-openssl=/usr/include --with-http_stub_status_module
--http-proxy-temp-path=/dev/shm/nginx/proxy_temp
--http-fastcgi-temp-path=/dev/shm/nginx/fastcgi_temp
--http-uwsgi-temp-path=/dev/shm/nginx/uwsgi_temp
--http-scgi-temp-path=/dev/shm/nginx/scgi_temp
--http-client-body-temp-path=/dev/shm/nginx/client_body_temp
--http-log-path=/var/log/nginx/access.log
--error-log-path=/var/log/nginx/error.log
--conf-path=/etc/nginx/nginx.conf --user=www-data --group=www-data
--------
и в соответствующем файле у меня стоит
в секции Server:
--------
location /status {
stub_status on;
access_log off;
allow 127.0.0.1;
deny all;
}
------
всё такие я получаю ошибку 404, когда я на
сервере наберу "GET domain/status"
В чем может состоить проблема?
Спасибо вам большое.
Андрей
Posted at Nginx Forum: http://forum.nginx.org/read.php?21,216178,216178#msg-216178
Здравствуйте.
Мы состоим в реестре организаторов распространения информации и
поэтому обязаны предоставлять в надзорный орган ключи tls сессий.
Для таких случаев существует механизм по перехвату вызовов библиотеки
openssl: https://git.lekensteyn.nl/peter/wireshark-notes/tree/src/
Суть простая - перед запуском демона, обрабатывающего TLS-соединения
клиентов, через LD_PRELOAD подгружается эта библиотека и она
сбрасывает в текстовый файл, указанный в переменой SSLKEYLOGFILE, ключи pre-master.
Эта схема срабатывает с апачем, но с энжинксом ключи не пишутся. Нет
ли идей или подсказок из-за чего это может быть и как вообще можно записать
эти самые pre-master keys в энжинксе?
Заранее спасибо.
P.S.
Пример файла с записанными ключами:
# SSL key logfile generated by sslkeylog.c
SERVER_HANDSHAKE_TRAFFIC_SECRET 077dca0cfc53f1ba5105d7e67e1cb8aa7fba40db73580bb0997498b3260a06da 080b47a6fea27728f15c4cb70bc7478aa4e9bf5b554e8018d9462a48fff90e9514ca6dc410154c730
CLIENT_HANDSHAKE_TRAFFIC_SECRET 077dca0cfc53f1ba5105d7e67e1cb8aa7fba40db73580bb0997498b3260a06da 883ec12435f3d53bc0e42f5fd0a26d006955064747786e21cda18bfa4e2b5fffe147860114036881d
EXPORTER_SECRET 077dca0cfc53f1ba5105d7e67e1cb8aa7fba40db73580bb0997498b3260a06da 267a950066d3c4bcc2fd3bb50287b045c213737d018f15c166dc82ce7eab5f4b4dcb3939bc11db1ec7c918a321b5d9f7
SERVER_TRAFFIC_SECRET_0 077dca0cfc53f1ba5105d7e67e1cb8aa7fba40db73580bb0997498b3260a06da cdd2a750c617a721dc93595b99852a4a2436a4fb2f843617b51f7bc0de3b9a88faa5b2b5256fa4230df7fdf9f
CLIENT_TRAFFIC_SECRET_0 077dca0cfc53f1ba5105d7e67e1cb8aa7fba40db73580bb0997498b3260a06da 0afb1f7f7c5d8fc9aefc8aae3111045d7e837e3f87de600fcf44a583f45a313d703235e6c80f51d1fa614d96f
P.P.S.
Запускаю энжинкс с этой библиотекой для записи ключей через systemd так:
#cat /etc/systemd/system/nginx.service.d/override.conf
[Service]
Environment=SSLKEYLOGFILE=/tmp/premaster.txt
Environment=LD_PRELOAD=/usr/local/lib/libsslkeylog.so
Через lsof видно, что эта библиотека для записи ключей энжиксом
подгружается (здесь я проверяю и мастер и воркер):
# lsof -n -p 10313 |grep ssl
nginx 10313 root mem REG 254,1 442984 3255 /usr/lib/x86_64-linux-gnu/libssl.so.1.1
nginx 10313 root mem REG 254,1 14224 20914 /usr/local/lib/libsslkeylog.so
# lsof -n -p 10314 |grep ssl
nginx 10314 www-data mem REG 254,1 442984 3255 /usr/lib/x86_64-linux-gnu/libssl.so.1.1
nginx 10314 www-data mem REG 254,1 14224 20914 /usr/local/lib/libsslkeylog.so
но тем не менее ключи в файл при обращении к энжинксу по https не
пишутся.
Всем привет.
Рад сообщить о выпуске новой версии NGINX Unit.
Этот релиз в основном включает ряд улучшений в поддержке приложений на
разных языках; в частности, добавлена поддержка входящих соединений по
протоколу WebSocket. Пока это коснулось только Node.js. На очереди -
поддержка в Java-модуле, которая уже почти завершена.
Чтобы принимать WebSocket-соединения в приложениях Node.js, вместо родного
объекта сервера воспользуйтесь объектом из нашего модуля unit-http:
var webSocketServer = require('unit-http/websocket').server;
Другой ожидаемой возможностью в этом релизе стало вычленение PATH_INFO
из пути запроса в PHP-модуле. Теперь Unit самостоятельно обрабатывает
запросы вида /app.php/some/path?some=args, которые иногда по старинке
используются для реализации семантических URL-ов.
Изменения в Unit 1.10.0 22.08.2019
*) Изменение: cookies в маршрутах теперь сопоставляются с учетом регистра.
*) Изменение: уменьшен уровень логирования распространенных ошибок,
возникающих, когда клиенты закрывают соединения.
*) Изменение: невостребованная опция "--include=" удалена из скрипта
./configure для Perl-модуля.
*) Добавление: встроенная реализация WebSocket-сервера для Node.js.
*) Добавление: вычленение PATH_INFO из URI запроса в PHP.
*) Добавление: маршрутизация запросов на основе схемы (HTTP или HTTPS).
*) Добавление: улучшена совместимость API c Node.js 11.10 и выше.
*) Исправление: ошибка переконфигурации при отсутствии объекта "listeners"
или "applications".
*) Исправление: возможный сбой при применении конфигурации большого объема.
Кроме того, с удовольствием отмечаю, что к работе над проектом подключились
два новых разработчика: Axel Duch и Tiago de Bem Natel de Moura.
Аксель уже реализовал для этого релиза сопоставление схемы и сейчас трудится
над дальнейшим расширением возможностей маршрутизации запросов по адресам
отправителя и получателя.
Параллельно Тьяго добился заметных успехов, работая над изоляцией процессов
приложений. За его трудом над поддержкой пространств имен Linux в Unit можно
наблюдать на GitHub:
- https://github.com/nginx/unit/pull/289
Также смотрите его сообщение с описанием предлагаемой функциональности:
- https://mailman.nginx.org/pipermail/nginx/2019-August/058321.html
Тем временем мы практически закончили работу над первичной поддержкой
проксирования и раздачи статики; с большой вероятностью новые возможности
(для начала в самом базовом виде) выйдут уже в следующем релизе, который
намечен на эту осень.
Следите за обновлениями.
--
Валентин Бартенев
Эта ошибка часто в логе для разных файлов. В гугле нашел что это решается
увеличением proxy_buffer_size, но он и так у нас 8k.
Подскажите как решить. Версия 1.16.1, OS FreeBSD 11.3. Из-за этой ошибки кеш
игнорируется и ресурс запрашивается из апстрима, а это дорогой контент
(google maps). Проблема только с этими ресурсами, другие кешируются
нормально. Урл не такой уж и длинный, вроде.
Пример ошибки:
2019/09/23 21:04:01 [crit] 95594#100948: *426913488 cache file
"/usr/home/nginx/cache/myproj/maps/d/2d/28889e499a0f9ef187ba9fb63270c2dd"
has too long header, client: 172.16.1.16, server: assets.example.com,
request: "GET
/maps/api/staticmap?key=AIzaSyBsXrvwBUBTrAMP0K-uCSJaH2cKU4xLPu4&markers=12.412358%2C53.823786&size=320x100&zoom=11
HTTP/1.1", host: "assets.example.com", referrer:
"https://example.com/foo/bar".
proxy_temp_path /usr/home/nginx/temp;
proxy_http_version 1.1;
proxy_headers_hash_max_size 1024;
proxy_headers_hash_bucket_size 128;
proxy_buffer_size 8k;
proxy_connect_timeout 15s;
proxy_send_timeout 5s;
proxy_cache_path /usr/home/nginx/cache/myproj/maps levels=1:2
keys_zone=myproj-maps:128m inactive=30d max_size=8g;
Posted at Nginx Forum: https://forum.nginx.org/read.php?21,285677,285677#msg-285677
привет!
если проверять nginx-1.17.4 вот этой утилитой
https://github.com/summerwind/h2spec
то несколько десятков тестов фейлятся. можете прокомментировать ?
[ilia@localhost h2spec]$ ./h2spec -p 443 -h xxx.xxx.ru -t http2
Hypertext Transfer Protocol Version 2 (HTTP/2)
3. Starting HTTP/2
3.5. HTTP/2 Connection Preface
✔ 1: Sends client connection preface
✔ 2: Sends invalid connection preface
4. HTTP Frames
4.1. Frame Format
✔ 1: Sends a frame with unknown type
✔ 2: Sends a frame with undefined flag
✔ 3: Sends a frame with reserved field bit
4.2. Frame Size
✔ 1: Sends a DATA frame with 2^14 octets in length
× 2: Sends a large size DATA frame that exceeds the
SETTINGS_MAX_FRAME_SIZE
-> The endpoint MUST send an error code of FRAME_SIZE_ERROR.
Expected: GOAWAY Frame (Error Code: FRAME_SIZE_ERROR)
RST_STREAM Frame (Error Code: FRAME_SIZE_ERROR)
Connection closed
Actual: WINDOW_UPDATE Frame (length:4, flags:0x00, stream_id:1)
✔ 3: Sends a large size HEADERS frame that exceeds the
SETTINGS_MAX_FRAME_SIZE
4.3. Header Compression and Decompression
✔ 1: Sends invalid header block fragment
✔ 2: Sends a PRIORITY frame while sending the header blocks
✔ 3: Sends a HEADERS frame to another stream while sending the header
blocks
5. Streams and Multiplexing
5.1. Stream States
× 1: idle: Sends a DATA frame
-> The endpoint MUST treat this as a connection error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: Timeout
× 2: idle: Sends a RST_STREAM frame
-> The endpoint MUST treat this as a connection error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: Timeout
× 3: idle: Sends a WINDOW_UPDATE frame
-> The endpoint MUST treat this as a connection error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: Timeout
✔ 4: idle: Sends a CONTINUATION frame
✔ 5: half closed (remote): Sends a DATA frame
✔ 6: half closed (remote): Sends a HEADERS frame
✔ 7: half closed (remote): Sends a CONTINUATION frame
× 8: closed: Sends a DATA frame after sending RST_STREAM frame
-> The endpoint MUST treat this as a stream error of type
STREAM_CLOSED.
Expected: GOAWAY Frame (Error Code: STREAM_CLOSED)
RST_STREAM Frame (Error Code: STREAM_CLOSED)
Connection closed
Actual: WINDOW_UPDATE Frame (length:4, flags:0x00, stream_id:1)
✔ 9: closed: Sends a HEADERS frame after sending RST_STREAM frame
✔ 10: closed: Sends a CONTINUATION frame after sending RST_STREAM
frame
× 11: closed: Sends a DATA frame
-> The endpoint MUST treat this as a connection error of type
STREAM_CLOSED.
Expected: GOAWAY Frame (Error Code: STREAM_CLOSED)
RST_STREAM Frame (Error Code: STREAM_CLOSED)
Connection closed
Actual: Timeout
✔ 12: closed: Sends a HEADERS frame
✔ 13: closed: Sends a CONTINUATION frame
5.1.1. Stream Identifiers
✔ 1: Sends even-numbered stream identifier
✔ 2: Sends stream identifier that is numerically smaller than
previous
5.1.2. Stream Concurrency
✔ 1: Sends HEADERS frames that causes their advertised concurrent
stream limit to be exceeded
5.3. Stream Priority
5.3.1. Stream Dependencies
✔ 1: Sends HEADERS frame that depend on itself
✔ 2: Sends PRIORITY frame that depend on itself
5.4. Error Handling
5.4.1. Connection Error Handling
× 1: Sends an invalid PING frame for connection close
-> The endpoint MUST close the TCP connection
Expected: Connection closed
Actual: PING Frame (length:8, flags:0x01, stream_id:0)
5.5. Extending HTTP/2
✔ 1: Sends an unknown extension frame
✔ 2: Sends an unknown extension frame in the middle of a header block
6. Frame Definitions
6.1. DATA
× 1: Sends a DATA frame with 0x0 stream identifier
-> The endpoint MUST respond with a connection error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: Timeout
✔ 2: Sends a DATA frame on the stream that is not in "open" or
"half-closed (local)" state
✔ 3: Sends a DATA frame with invalid pad length
6.2. HEADERS
✔ 1: Sends a HEADERS frame without the END_HEADERS flag, and a
PRIORITY frame
✔ 2: Sends a HEADERS frame to another stream while sending a HEADERS
frame
✔ 3: Sends a HEADERS frame with 0x0 stream identifier
✔ 4: Sends a HEADERS frame with invalid pad length
6.3. PRIORITY
✔ 1: Sends a PRIORITY frame with 0x0 stream identifier
✔ 2: Sends a PRIORITY frame with a length other than 5 octets
6.4. RST_STREAM
✔ 1: Sends a RST_STREAM frame with 0x0 stream identifier
× 2: Sends a RST_STREAM frame on a idle stream
-> The endpoint MUST respond with a connection error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: Timeout
✔ 3: Sends a RST_STREAM frame with a length other than 4 octets
6.5. SETTINGS
✔ 1: Sends a SETTINGS frame with ACK flag and payload
× 2: Sends a SETTINGS frame with a stream identifier other than 0x0
-> The endpoint MUST respond with a connection error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: SETTINGS Frame (length:0, flags:0x01, stream_id:0)
✔ 3: Sends a SETTINGS frame with a length other than a multiple of 6
octets
6.5.2. Defined SETTINGS Parameters
✔ 1: SETTINGS_ENABLE_PUSH (0x2): Sends the value other than 0 or 1
✔ 2: SETTINGS_INITIAL_WINDOW_SIZE (0x4): Sends the value above the
maximum flow control window size
✔ 3: SETTINGS_MAX_FRAME_SIZE (0x5): Sends the value below the
initial value
✔ 4: SETTINGS_MAX_FRAME_SIZE (0x5): Sends the value above the
maximum allowed frame size
✔ 5: Sends a SETTINGS frame with unknown identifier
6.5.3. Settings Synchronization
✔ 1: Sends multiple values of SETTINGS_INITIAL_WINDOW_SIZE
✔ 2: Sends a SETTINGS frame without ACK flag
6.7. PING
✔ 1: Sends a PING frame
✔ 2: Sends a PING frame with ACK
× 3: Sends a PING frame with a stream identifier field value other
than 0x0
-> The endpoint MUST respond with a connection error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: PING Frame (length:8, flags:0x01, stream_id:0)
✔ 4: Sends a PING frame with a length field value other than 8
6.8. GOAWAY
× 1: Sends a GOAWAY frame with a stream identifier other than 0x0
-> The endpoint MUST treat this as a connection error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: Timeout
6.9. WINDOW_UPDATE
✔ 1: Sends a WINDOW_UPDATE frame with a flow control window increment
of 0
✔ 2: Sends a WINDOW_UPDATE frame with a flow control window increment
of 0 on a stream
✔ 3: Sends a WINDOW_UPDATE frame with a length other than 4 octets
6.9.1. The Flow-Control Window
✔ 1: Sends SETTINGS frame to set the initial window size to 1 and
sends HEADERS frame
✔ 2: Sends multiple WINDOW_UPDATE frames increasing the flow
control window to above 2^31-1
✔ 3: Sends multiple WINDOW_UPDATE frames increasing the flow
control window to above 2^31-1 on a stream
6.9.2. Initial Flow-Control Window Size
✔ 1: Changes SETTINGS_INITIAL_WINDOW_SIZE after sending HEADERS
frame
✔ 2: Sends a SETTINGS frame for window size to be negative
✔ 3: Sends a SETTINGS_INITIAL_WINDOW_SIZE settings with an exceeded
maximum window size value
6.10. CONTINUATION
✔ 1: Sends multiple CONTINUATION frames preceded by a HEADERS frame
✔ 2: Sends a CONTINUATION frame followed by any frame other than
CONTINUATION
✔ 3: Sends a CONTINUATION frame with 0x0 stream identifier
✔ 4: Sends a CONTINUATION frame preceded by a HEADERS frame with
END_HEADERS flag
✔ 5: Sends a CONTINUATION frame preceded by a CONTINUATION frame with
END_HEADERS flag
✔ 6: Sends a CONTINUATION frame preceded by a DATA frame
7. Error Codes
✔ 1: Sends a GOAWAY frame with unknown error code
✔ 2: Sends a RST_STREAM frame with unknown error code
8. HTTP Message Exchanges
8.1. HTTP Request/Response Exchange
✔ 1: Sends a second HEADERS frame without the END_STREAM flag
8.1.2. HTTP Header Fields
✔ 1: Sends a HEADERS frame that contains the header field name in
uppercase letters
8.1.2.1. Pseudo-Header Fields
× 1: Sends a HEADERS frame that contains a unknown pseudo-header
field
-> The endpoint MUST respond with a stream error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: DATA Frame (length:150, flags:0x01, stream_id:1)
× 2: Sends a HEADERS frame that contains the pseudo-header field
defined for response
-> The endpoint MUST respond with a stream error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: DATA Frame (length:150, flags:0x01, stream_id:1)
✔ 3: Sends a HEADERS frame that contains a pseudo-header field as
trailers
× 4: Sends a HEADERS frame that contains a pseudo-header field
that appears in a header block after a regular header field
-> The endpoint MUST respond with a stream error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: DATA Frame (length:0, flags:0x01, stream_id:1)
8.1.2.2. Connection-Specific Header Fields
× 1: Sends a HEADERS frame that contains the connection-specific
header field
-> The endpoint MUST respond with a stream error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: DATA Frame (length:0, flags:0x01, stream_id:1)
× 2: Sends a HEADERS frame that contains the TE header field with
any value other than "trailers"
-> The endpoint MUST respond with a stream error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: DATA Frame (length:0, flags:0x01, stream_id:1)
8.1.2.3. Request Pseudo-Header Fields
× 1: Sends a HEADERS frame with empty ":path" pseudo-header field
-> The endpoint MUST respond with a stream error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: DATA Frame (length:150, flags:0x01, stream_id:1)
× 2: Sends a HEADERS frame that omits ":method" pseudo-header
field
-> The endpoint MUST respond with a stream error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: DATA Frame (length:150, flags:0x01, stream_id:1)
× 3: Sends a HEADERS frame that omits ":scheme" pseudo-header
field
-> The endpoint MUST respond with a stream error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: DATA Frame (length:150, flags:0x01, stream_id:1)
× 4: Sends a HEADERS frame that omits ":path" pseudo-header field
-> The endpoint MUST respond with a stream error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: DATA Frame (length:150, flags:0x01, stream_id:1)
× 5: Sends a HEADERS frame with duplicated ":method"
pseudo-header field
-> The endpoint MUST respond with a stream error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: DATA Frame (length:150, flags:0x01, stream_id:1)
× 6: Sends a HEADERS frame with duplicated ":scheme"
pseudo-header field
-> The endpoint MUST respond with a stream error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: DATA Frame (length:150, flags:0x01, stream_id:1)
× 7: Sends a HEADERS frame with duplicated ":path" pseudo-header
field
-> The endpoint MUST respond with a stream error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: DATA Frame (length:150, flags:0x01, stream_id:1)
8.1.2.6. Malformed Requests and Responses
× 1: Sends a HEADERS frame with the "content-length" header field
which does not equal the DATA frame payload length
-> The endpoint MUST treat this as a stream error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: DATA Frame (length:150, flags:0x01, stream_id:1)
× 2: Sends a HEADERS frame with the "content-length" header field
which does not equal the sum of the multiple DATA frames payload length
-> The endpoint MUST treat this as a stream error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: DATA Frame (length:150, flags:0x01, stream_id:1)
8.2. Server Push
✔ 1: Sends a PUSH_PROMISE frame
Failures:
Hypertext Transfer Protocol Version 2 (HTTP/2)
4. HTTP Frames
4.2. Frame Size
× 2: Sends a large size DATA frame that exceeds the
SETTINGS_MAX_FRAME_SIZE
-> The endpoint MUST send an error code of FRAME_SIZE_ERROR.
Expected: GOAWAY Frame (Error Code: FRAME_SIZE_ERROR)
RST_STREAM Frame (Error Code: FRAME_SIZE_ERROR)
Connection closed
Actual: WINDOW_UPDATE Frame (length:4, flags:0x00, stream_id:1)
5. Streams and Multiplexing
5.1. Stream States
× 1: idle: Sends a DATA frame
-> The endpoint MUST treat this as a connection error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: Timeout
× 2: idle: Sends a RST_STREAM frame
-> The endpoint MUST treat this as a connection error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: Timeout
× 3: idle: Sends a WINDOW_UPDATE frame
-> The endpoint MUST treat this as a connection error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: Timeout
× 8: closed: Sends a DATA frame after sending RST_STREAM frame
-> The endpoint MUST treat this as a stream error of type
STREAM_CLOSED.
Expected: GOAWAY Frame (Error Code: STREAM_CLOSED)
RST_STREAM Frame (Error Code: STREAM_CLOSED)
Connection closed
Actual: WINDOW_UPDATE Frame (length:4, flags:0x00, stream_id:1)
× 11: closed: Sends a DATA frame
-> The endpoint MUST treat this as a connection error of type
STREAM_CLOSED.
Expected: GOAWAY Frame (Error Code: STREAM_CLOSED)
RST_STREAM Frame (Error Code: STREAM_CLOSED)
Connection closed
Actual: Timeout
5.4. Error Handling
5.4.1. Connection Error Handling
× 1: Sends an invalid PING frame for connection close
-> The endpoint MUST close the TCP connection
Expected: Connection closed
Actual: PING Frame (length:8, flags:0x01, stream_id:0)
6. Frame Definitions
6.1. DATA
× 1: Sends a DATA frame with 0x0 stream identifier
-> The endpoint MUST respond with a connection error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: Timeout
6.4. RST_STREAM
× 2: Sends a RST_STREAM frame on a idle stream
-> The endpoint MUST respond with a connection error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: Timeout
6.5. SETTINGS
× 2: Sends a SETTINGS frame with a stream identifier other than 0x0
-> The endpoint MUST respond with a connection error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: SETTINGS Frame (length:0, flags:0x01, stream_id:0)
6.7. PING
× 3: Sends a PING frame with a stream identifier field value other
than 0x0
-> The endpoint MUST respond with a connection error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: PING Frame (length:8, flags:0x01, stream_id:0)
6.8. GOAWAY
× 1: Sends a GOAWAY frame with a stream identifier other than 0x0
-> The endpoint MUST treat this as a connection error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: Timeout
8. HTTP Message Exchanges
8.1. HTTP Request/Response Exchange
8.1.2. HTTP Header Fields
8.1.2.1. Pseudo-Header Fields
× 1: Sends a HEADERS frame that contains a unknown pseudo-header
field
-> The endpoint MUST respond with a stream error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: DATA Frame (length:150, flags:0x01, stream_id:1)
× 2: Sends a HEADERS frame that contains the pseudo-header field
defined for response
-> The endpoint MUST respond with a stream error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: DATA Frame (length:150, flags:0x01, stream_id:1)
× 4: Sends a HEADERS frame that contains a pseudo-header field
that appears in a header block after a regular header field
-> The endpoint MUST respond with a stream error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: DATA Frame (length:0, flags:0x01, stream_id:1)
8.1.2.2. Connection-Specific Header Fields
× 1: Sends a HEADERS frame that contains the connection-specific
header field
-> The endpoint MUST respond with a stream error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: DATA Frame (length:0, flags:0x01, stream_id:1)
× 2: Sends a HEADERS frame that contains the TE header field with
any value other than "trailers"
-> The endpoint MUST respond with a stream error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: DATA Frame (length:0, flags:0x01, stream_id:1)
8.1.2.3. Request Pseudo-Header Fields
× 1: Sends a HEADERS frame with empty ":path" pseudo-header field
-> The endpoint MUST respond with a stream error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: DATA Frame (length:150, flags:0x01, stream_id:1)
× 2: Sends a HEADERS frame that omits ":method" pseudo-header
field
-> The endpoint MUST respond with a stream error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: DATA Frame (length:150, flags:0x01, stream_id:1)
× 3: Sends a HEADERS frame that omits ":scheme" pseudo-header
field
-> The endpoint MUST respond with a stream error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: DATA Frame (length:150, flags:0x01, stream_id:1)
× 4: Sends a HEADERS frame that omits ":path" pseudo-header field
-> The endpoint MUST respond with a stream error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: DATA Frame (length:150, flags:0x01, stream_id:1)
× 5: Sends a HEADERS frame with duplicated ":method"
pseudo-header field
-> The endpoint MUST respond with a stream error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: DATA Frame (length:150, flags:0x01, stream_id:1)
× 6: Sends a HEADERS frame with duplicated ":scheme"
pseudo-header field
-> The endpoint MUST respond with a stream error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: DATA Frame (length:150, flags:0x01, stream_id:1)
× 7: Sends a HEADERS frame with duplicated ":path" pseudo-header
field
-> The endpoint MUST respond with a stream error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: DATA Frame (length:150, flags:0x01, stream_id:1)
8.1.2.6. Malformed Requests and Responses
× 1: Sends a HEADERS frame with the "content-length" header field
which does not equal the DATA frame payload length
-> The endpoint MUST treat this as a stream error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: DATA Frame (length:150, flags:0x01, stream_id:1)
× 2: Sends a HEADERS frame with the "content-length" header field
which does not equal the sum of the multiple DATA frames payload length
-> The endpoint MUST treat this as a stream error of type
PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: DATA Frame (length:150, flags:0x01, stream_id:1)
Finished in 72.3573 seconds
94 tests, 68 passed, 0 skipped, 26 failed
[ilia@localhost h2spec]$
В случае если proxy апстрим не доступен на уровне сокета (ECONNREFUSED, а не
просто вернулось HTTP 5хх), будет ли nginx ретраить POST запрос на следующих
апстримах? По идее должен т.к. запрос никем не был принят и обработан.
Posted at Nginx Forum: https://forum.nginx.org/read.php?21,285751,285751#msg-285751
Добрый день, прошу помочь разобраться с проблемой:
Nginx 1.16.1 (проблема была и на прошлых версиях) из оф репозитория nginx
для debian, openssl 1.1.1c (проблема есть и на openssl 1.1.0)
Прописываю два ключа RSA & *ECDSA*. Пробовал ключи как от LE так и от comoda
Пример настроек:
> ssl_session_cache shared:SSL:5m;
> ssl_session_timeout 30m;
> ssl_ecdh_curve X25519:prime256v1;
> ssl_buffer_size 4k;
> ssl_session_tickets off;
> resolver 8.8.8.8 8.8.4.4 valid=5m; #ipv6=off
> resolver_timeout 1s;
> ssl_prefer_server_ciphers on;
> ssl_protocols TLSv1.2 TLSv1.3;
> ssl_ciphers
> 'TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384';
> ssl_stapling on; - включал выключал, разницы нет.
Время хендшейка около 40мс.
Если оставить только RSA то время уменьшается до 10мс
Если оставить только EDSA, то время незначительно меняется и равно 38-39мс
Если проверять скорость подписей openssl то ECDSA реально быстрее RSA, но
почему при https подключении этого не видно?
Проверял как чистым curl, так и black box экспортером для отслеживания
динамики.
Прошу помочь разобраться с данным нюансом
всем привет
подкажите плиз
нужно блокировать ip по заголовку:
http_x_forward_for":«10.13.2.14, 10.99.111.25:13555
нужно блокировать только если эти два ip вместе приходят
пробовал разные способы. все равно проходит
пример
if ($http_x_forward_for ~ " ?10\.13\.2\.14*") {
return 403;
Posted at Nginx Forum: https://forum.nginx.org/read.php?21,285707,285707#msg-285707
Изменения в nginx 1.17.4 24.09.2019
*) Изменение: улучшено детектирование некорректного поведения клиентов в
HTTP/2.
*) Изменение: в обработке непрочитанного тела запроса при возврате
ошибок в HTTP/2.
*) Исправление: директива worker_shutdown_timeout могла не работать при
использовании HTTP/2.
*) Исправление: при использовании HTTP/2 и директивы
proxy_request_buffering в рабочем процессе мог произойти segmentation
fault.
*) Исправление: на Windows при использовании SSL уровень записи в лог
ошибки ECONNABORTED был "crit" вместо "error".
*) Исправление: nginx игнорировал лишние данные при использовании
chunked transfer encoding.
*) Исправление: если использовалась директива return и при чтении тела
запроса возникала ошибка, nginx всегда возвращал ошибку 500.
*) Исправление: в обработке ошибок выделения памяти.
--
Maxim Dounin
http://nginx.org/