Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2020
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 KB | None | 0 0
  1. # Common settings for nginx-push-stream-module
  2. push_stream_shared_memory_size 256M;
  3. push_stream_max_messages_stored_per_channel 1000;
  4. push_stream_max_channel_id_length 32;
  5. push_stream_max_number_of_channels 200000;
  6. push_stream_message_ttl 86400;
  7.  
  8. ######################################################
  9. # поддержка мобильных платформ, для http запросов
  10. server {
  11. # nginx-push-stream-module server for push & pull
  12.  
  13. listen 8893;
  14. server_name _;
  15.  
  16. # Include error handlers
  17. #include bx/conf/errors.conf;
  18.  
  19. # Include im subscrider handlers
  20. # Location for long-polling connections
  21. location ^~ /bitrix/sub/ {
  22.  
  23. # we don't use callback and droppped it (XSS)
  24. if ( $arg_callback ) {
  25. return 400;
  26. }
  27.  
  28. push_stream_subscriber long-polling;
  29. push_stream_allowed_origins "*";
  30. push_stream_channels_path $arg_CHANNEL_ID;
  31. push_stream_last_received_message_tag $arg_tag;
  32. if ($arg_time) {
  33. push_stream_last_received_message_time "$arg_time";
  34. }
  35. push_stream_longpolling_connection_ttl 40;
  36. push_stream_authorized_channels_only on;
  37. push_stream_message_template '#!NGINXNMS!#{"id":~id~,"channel":"~channel~","tag":"~tag~","time":"~time~","eventid":"~event-id~","text":~text~}#!NGINXNME!#';
  38. }
  39.  
  40. # Location for websocet connections
  41. location ^~ /bitrix/subws/ {
  42. push_stream_subscriber websocket;
  43. push_stream_channels_path $arg_CHANNEL_ID;
  44. push_stream_websocket_allow_publish off;
  45. push_stream_ping_message_interval 40s;
  46. push_stream_authorized_channels_only on;
  47. push_stream_last_received_message_tag "$arg_tag";
  48. push_stream_last_received_message_time "$arg_time";
  49. push_stream_message_template '#!NGINXNMS!#{"id":~id~,"channel":"~channel~","tag":"~tag~","time":"~time~","eventid":"~event-id~","text":~text~}#!NGINXNME!#';
  50. }
  51.  
  52. location ^~ / { deny all; }
  53. }
  54.  
  55. ######################################################
  56. # для публикации сообщений
  57. # Server to push messages to user channels
  58. server {
  59. listen 8895;
  60. server_name _;
  61.  
  62. location ^~ /bitrix/pub/ {
  63. push_stream_publisher admin;
  64. push_stream_channels_path $arg_CHANNEL_ID;
  65. push_stream_store_messages on;
  66. allow all;
  67. #deny all;
  68. }
  69.  
  70. location ^~ / { deny all; }
  71.  
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement