Figured out the reason of the errors: multi workers was on auto instead of 1. nginx_rtmp_module works well only with 1 worker