Настройка модуля Push and Pull birix модуля nginx с ISPmanager

Компилим nginx с модулем утянув его выше в папку из git https://github.com/wandenberg/nginx-push-stream-module

./configure --add-module=../nginx-push-stream-module

делаем общую include в /etc/nginx/conf.d/push-stream-module.conf

push_stream_shared_memory_size 256M;
push_stream_max_messages_stored_per_channel 1000;
push_stream_max_channel_id_length 32;
push_stream_max_number_of_channels 200000;
push_stream_message_ttl 86400;


делаем инклюдку для server {}

include /etc/nginx/push-stream-module-vhost.inc 

# Location for long-polling connections
location ^~ /bitrix/sub {
    # we don't use callback and droppped it (XSS)
    if ( $arg_callback ) {
        return 400;
    }

    push_stream_subscriber            long-polling;
    push_stream_allowed_origins "*";
    push_stream_channels_path        $arg_CHANNEL_ID;
    push_stream_last_received_message_tag    $arg_tag;
    if ($arg_time) {
        push_stream_last_received_message_time "$arg_time";
    }
    push_stream_longpolling_connection_ttl    40;
    push_stream_authorized_channels_only    on;
    push_stream_message_template '#!NGINXNMS!#{"id":~id~,"channel":"~channel~","tag":"~tag~","time":"~time~","eventid":"~event-id~","text":~text~}#!NGINXNME!#';
}

# Location for websocet connections
location ^~ /bitrix/subws/ {
    push_stream_subscriber websocket;
    push_stream_channels_path        $arg_CHANNEL_ID;
    push_stream_websocket_allow_publish    off;
    push_stream_ping_message_interval    40s;
    push_stream_authorized_channels_only     on;
    push_stream_last_received_message_tag    "$arg_tag";
    push_stream_last_received_message_time    "$arg_time";
    push_stream_message_template '#!NGINXNMS!#{"id":~id~,"channel":"~channel~","tag":"~tag~","time":"~time~","eventid":"~event-id~","text":~text~}#!NGINXNME!#';
}


Включаем в битриксе

Оригинал https://dermanov.ru/exp/configure-push-and-pull-module-for-bitrix24/

Комментариев нет:

Отправить комментарий