Setting up the Bitrix Push & Pull server

Our company is engaged in the development, support and maintenance of Bitrix and Bitrix24 solutions of any complexity. From simple one-page sites to complex online stores, CRM systems with 1C and telephony integration. The experience of developers is confirmed by certificates from the vendor.
Our competencies:
Development stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1175
  • image_bitrix-bitrix-24-1c_fixper_448_0.png
    Website development for FIXPER company
    811
  • image_bitrix-bitrix-24-1c_development_of_an_online_appointment_booking_widget_for_a_medical_center_594_0.webp
    Development based on Bitrix, Bitrix24, 1C for the company Development of an Online Appointment Booking Widget for a Medical Center
    564
  • image_bitrix-bitrix-24-1c_mirsanbel_458_0.webp
    Development based on 1C Enterprise for MIRSANBEL
    747
  • image_crm_dolbimby_434_0.webp
    Website development on CRM Bitrix24 for DOLBIMBY
    655
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    976

Setting up Bitrix Push & Pull server

Push & Pull is a Bitrix technology for real-time notifications: new chat messages, task updates, order notifications. Works via WebSocket or Long Polling. Without Push & Pull, Bitrix24 out of the box and live notifications in an online store (order status change) don't work.

Push & Pull architecture

Push server — separate Node.js process that holds WebSocket connections with user browsers. PHP backend sends messages to Push server via HTTP, Push server broadcasts them to connected clients.

Components:

  • nodejs — runs Push server
  • push.sender module in Bitrix — PHP API for sending messages
  • pull module — client part, browser subscription

Installing Node.js

# Via NodeSource (LTS recommended)
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt-get install -y nodejs

# Check
node --version  # v20.x.x
npm --version

Installing Bitrix Push server

Push server is distributed via npm:

npm install -g bitrix-push-server

Or download manually from marketplace.1c-bitrix.ru — package bitrix.push-server.

Launch:

bitrix-push-server --config /etc/bitrix/push-server.json

Example config /etc/bitrix/push-server.json:

{
    "security": {
        "key": "SECRET_KEY_HERE"
    },
    "server": {
        "port": 8893,
        "hostname": "0.0.0.0"
    },
    "serverHTTPS": {
        "port": 8894,
        "hostname": "0.0.0.0",
        "key": "/etc/ssl/private/site.key",
        "cert": "/etc/ssl/certs/site.crt"
    },
    "log": {
        "level": "info",
        "file": "/var/log/bitrix-push-server.log"
    }
}

SECRET_KEY_HERE — any long random string. Same key is set in Bitrix Push module settings.

Nginx configuration for proxying

Push server listens on port 8893 (HTTP) and 8894 (HTTPS). Nginx proxies WebSocket connections:

location /bitrix/subws/ {
    proxy_pass http://127.0.0.1:8893/bitrix/subws/;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
    proxy_set_header Host $host;
    proxy_read_timeout 3600;
    proxy_send_timeout 3600;
}

location /bitrix/sub/ {
    proxy_pass http://127.0.0.1:8893/bitrix/sub/;
    proxy_http_version 1.1;
    proxy_set_header Host $host;
    proxy_read_timeout 3600;
}

location /bitrix/rest/ {
    proxy_pass http://127.0.0.1:8893/bitrix/rest/;
    proxy_set_header Host $host;
}

Configuring module in Bitrix

Settings → Product Settings → Module Settings → Push and Pull:

  • Public pathhttps://yoursite.ru/bitrix/
  • Private pathhttp://127.0.0.1:8893/bitrix/ (for PHP backend)
  • Signature key — same SECRET_KEY_HERE

After saving, check: go to Bitrix24 or notification section — in DevTools → Network WebSocket connections to /bitrix/subws/ should appear.

Auto-start via systemd

# /etc/systemd/system/bitrix-push.service
[Unit]
Description=Bitrix Push Server
After=network.target

[Service]
Type=simple
User=www-data
ExecStart=/usr/bin/bitrix-push-server --config /etc/bitrix/push-server.json
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target
systemctl enable bitrix-push
systemctl start bitrix-push
systemctl status bitrix-push