Views: 3784
Last Modified: 10.03.2021

When project is located on a separate server, you need to configure path settings within the Push & Pull module, allowing modern browsers to access queue server directly.

Before this option became available in version 15.5.1, queries had to be proxied. (Query was sent to site server, because old browsers doesn't support direct AJAX queries to other domains, and then query is forwarded from there to a queue server via internal rules). This manoeuvre created load and excessive traffic.

Now all new browsers directly query servers. However, due to Bitrix24-related technical specifics of JS and server interaction, such browsers have to additionally execute a query to each OPTIONS connection. To avoid this, server configuration files must be updated.

Open the file bx/conf/im_subscrider.conf, and within the location location ^~ /bitrix/sub {, check is your have the condition as follows:

if ($arg_time) {
    push_stream_last_received_message_time "$arg_time";
}

If not, add such condition. It should look approximately as follows:

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";
 }

Next, use the method COption::SetOptionString:

COption::SetOptionString("pull", "nginx_headers", "N");

After that, when connecting, all users will generate a one server query less (it will occur not immediately, but during JS code updating at the clients side and page reload).




Courses developed by Bitrix24