Sample config indent and channels-stats location

parent fe9201be
......@@ -39,7 +39,7 @@ h2(#basic-configuration). Basic Configuration
<pre>
<code>
location /channels_stats {
location /channels-stats {
# activate channels statistics mode for this location
push_stream_channels_statistics;
......@@ -53,6 +53,7 @@ h2(#basic-configuration). Basic Configuration
# query string based channel id
set $push_stream_channel_id $arg_id;
push_stream_max_channel_id_length 200;
# message template
push_stream_message_template "<script>p(~id~,'~channel~','~text~');</script>";
# store messages in memory
......@@ -62,6 +63,7 @@ h2(#basic-configuration). Basic Configuration
# message ttl
push_stream_min_message_buffer_timeout 5m;
# Message size limit
# client_max_body_size MUST be equal to client_body_buffer_size or
# you will be sorry.
client_max_body_size 32k;
......@@ -73,13 +75,14 @@ h2(#basic-configuration). Basic Configuration
push_stream_subscriber;
# positional channel path
set $push_stream_channels_path $1;
set $push_stream_channels_path $1;
push_stream_max_channel_id_length 200;
# header to be sent when receiving new subscriber connection
push_stream_header_template "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n<meta http-equiv=\"Cache-Control\" content=\"no-store\">\r\n<meta http-equiv=\"Cache-Control\" content=\"no-cache\">\r\n<meta http-equiv=\"Pragma\" content=\"no-cache\">\r\n<meta http-equiv=\"Expires\" content=\"Thu, 1 Jan 1970 00:00:00 GMT\">\r\n<script type=\"text/javascript\">\r\nwindow.onError = null;\r\ndocument.domain = 'localhost';\r\nparent.PushStream.register(this);\r\n</script>\r\n</head>\r\n<body onload=\"try { parent.PushStream.reset(this) } catch (e) {}\">";
push_stream_header_template "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n<meta http-equiv=\"Cache-Control\" content=\"no-store\">\r\n<meta http-equiv=\"Cache-Control\" content=\"no-cache\">\r\n<meta http-equiv=\"Pragma\" content=\"no-cache\">\r\n<meta http-equiv=\"Expires\" content=\"Thu, 1 Jan 1970 00:00:00 GMT\">\r\n<script type=\"text/javascript\">\r\nwindow.onError = null;\r\ndocument.domain = 'localhost';\r\nparent.PushStream.register(this);\r\n</script>\r\n</head>\r\n<body onload=\"try { parent.PushStream.reset(this) } catch (e) {}\">";
# message template
push_stream_message_template "<script>p(~id~,'~channel~','~text~');</script>";
push_stream_message_template "<script>p(~id~,'~channel~','~text~');</script>";
# content-type
push_stream_content_type "text/html; charset=utf-8";
push_stream_content_type "text/html; charset=utf-8";
# subscriber may create channels on demand or only authorized
# (publisher) may do it?
push_stream_authorized_channels_only off;
......@@ -87,6 +90,9 @@ h2(#basic-configuration). Basic Configuration
push_stream_ping_message_interval 10s;
# connection ttl to enable recycle
push_stream_subscriber_connection_timeout 15m;
# broadcast
push_stream_broadcast_channel_prefix "broad_";
push_stream_broadcast_channel_max_qtd 3;
# solving some leakage problem with persistent connections in
# Nginx's chunked filter (ngx_http_chunked_filter_module.c)
......@@ -112,13 +118,13 @@ one terminal and start playing http pubsub:
curl -s -v "http://localhost/pub?id=my_channel_1"
# All Channels Stats summarized (json format)
curl -s -v "http://localhost/channels_stats"
curl -s -v "http://localhost/channels-stats"
# All Channels Stats detailed (json format)
curl -s -v "http://localhost/channels_stats?id=ALL"
curl -s -v "http://localhost/channels-stats?id=ALL"
# Channels Stats (json format)
curl -s -v "http://localhost/channels_stats?id=my_channel_1"
curl -s -v "http://localhost/channels-stats?id=my_channel_1"
</code>
</pre>
......@@ -138,7 +144,7 @@ A string to uniquely identify a communication channel. Must be present on locati
<code>
set $push_channel_id $arg_id;
#channel id is now the url query string parameter "id"
#(/pub?id=channel_id_string or /channels_stats?id=channel_id_string)
#(/pub?id=channel_id_string or /channels-stats?id=channel_id_string)
</code>
</pre>
......@@ -197,14 +203,14 @@ You can get statistics in the formats plain, xml, yaml and json. The default is
<pre>
<code>
location /channels_stats {
location /channels-stats {
push_stream_channels_statistics;
set $push_stream_channel_id $arg_id;
}
# /channels_stats -> get statistics about all channels in a summarized way
# /channels_stats?id=ALL -> get statistics about all channels in a detailed way
# /channels_stats?id=channel_id -> get statistics about a channel
# /channels-stats -> get statistics about all channels in a summarized way
# /channels-stats?id=ALL -> get statistics about all channels in a detailed way
# /channels-stats?id=channel_id -> get statistics about a channel
</code>
</pre>
......
pid logs/nginx.pid;
error_log logs/nginx-main_error.log debug;
pid logs/nginx.pid;
error_log logs/nginx-main_error.log debug;
# Development Mode
master_process off;
daemon off;
worker_processes 2;
master_process off;
daemon off;
worker_processes 2;
events {
worker_connections 1024;
......@@ -36,7 +37,7 @@ http {
listen 80;
server_name localhost;
location /channels_stats {
location /channels-stats {
# activate channels statistics mode for this location
push_stream_channels_statistics;
......@@ -50,17 +51,17 @@ http {
# query string based channel id
set $push_stream_channel_id $arg_id;
push_stream_max_channel_id_length 200;
# message template
push_stream_message_template "<script>p(~id~,'~channel~','~text~');</script>";
# store messages
push_stream_store_messages on;
# store messages in memory
push_stream_store_messages on;
# max messages to store in memory
push_stream_max_message_buffer_length 20;
# message ttl
push_stream_min_message_buffer_timeout 5m;
push_stream_max_channel_id_length 200;
# Message size limit
# client_max_body_size MUST be equal to client_body_buffer_size or
# you will be sorry.
client_max_body_size 32k;
......@@ -72,14 +73,14 @@ http {
push_stream_subscriber;
# positional channel path
set $push_stream_channels_path $1;
push_stream_max_channel_id_length 200;
set $push_stream_channels_path $1;
push_stream_max_channel_id_length 200;
# header to be sent when receiving new subscriber connection
push_stream_header_template "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n<meta http-equiv=\"Cache-Control\" content=\"no-store\">\r\n<meta http-equiv=\"Cache-Control\" content=\"no-cache\">\r\n<meta http-equiv=\"Pragma\" content=\"no-cache\">\r\n<meta http-equiv=\"Expires\" content=\"Thu, 1 Jan 1970 00:00:00 GMT\">\r\n<script type=\"text/javascript\">\r\nwindow.onError = null;\r\ndocument.domain = 'localhost';\r\nparent.PushStream.register(this);\r\n</script>\r\n</head>\r\n<body onload=\"try { parent.PushStream.reset(this) } catch (e) {}\">";
push_stream_header_template "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n<meta http-equiv=\"Cache-Control\" content=\"no-store\">\r\n<meta http-equiv=\"Cache-Control\" content=\"no-cache\">\r\n<meta http-equiv=\"Pragma\" content=\"no-cache\">\r\n<meta http-equiv=\"Expires\" content=\"Thu, 1 Jan 1970 00:00:00 GMT\">\r\n<script type=\"text/javascript\">\r\nwindow.onError = null;\r\ndocument.domain = 'localhost';\r\nparent.PushStream.register(this);\r\n</script>\r\n</head>\r\n<body onload=\"try { parent.PushStream.reset(this) } catch (e) {}\">";
# message template
push_stream_message_template "<script>p(~id~,'~channel~','~text~');</script>";
push_stream_message_template "<script>p(~id~,'~channel~','~text~');</script>";
# content-type
push_stream_content_type "text/html; charset=utf-8";
push_stream_content_type "text/html; charset=utf-8";
# subscriber may create channels on demand or only authorized
# (publisher) may do it?
push_stream_authorized_channels_only off;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment