Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Common settings for nginx-push-stream-module
- 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;
- ######################################################
- # поддержка мобильных платформ, для http запросов
- server {
- # nginx-push-stream-module server for push & pull
- listen 8893;
- server_name _;
- # Include error handlers
- #include bx/conf/errors.conf;
- # Include im subscrider handlers
- # 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!#';
- }
- location ^~ / { deny all; }
- }
- ######################################################
- # для публикации сообщений
- # Server to push messages to user channels
- server {
- listen 8895;
- server_name _;
- location ^~ /bitrix/pub/ {
- push_stream_publisher admin;
- push_stream_channels_path $arg_CHANNEL_ID;
- push_stream_store_messages on;
- allow all;
- #deny all;
- }
- location ^~ / { deny all; }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement