Closed AlexeyKupershtokh closed 10 years ago
With the version on branch 0.4.x (and on the next release version) you will be able to create two different http blocks, each one with a shared memory zone. With that the servers will not receive messages from the other server. Something like that.
http { push_stream_shared_memory_size 100m project1;
server { server_name project1.myserver.com; location /pub { ... } location ~ /sub-ev/(.*) { ... } }
}
http {
push_stream_shared_memory_size 100m project2; server { server_name project2.myserver.com; location /pub { ... } location ~ /sub-ev/(.*) { ... } }
}
On Wed, Nov 6, 2013 at 12:29 AM, Alexey Kupershtokh < notifications@github.com> wrote:
Hello. I would like to use nginx-push-stream-module with a few separate projects and would like them use intersecting channel names. But I want to make the them isolated somehow by identifying a bus they publish/subscribe. A configuration example would look something like defining two hosts in the same nginx:
server { server_name project1.myserver.com; push_stream_busid project1; location /pub { ... } location ~ /sub-ev/(.) { ... } } server { server_name project2.myserver.com; push_stream_busid project2; location /pub { ... } location ~ /sub-ev/(.) { ... } }
In this theoretical example http://project1.myserver.com/sub-ev/ch1 would receive messages published to http://project1.myserver.com/pub/ch1 but not to http://project2.myserver.com/pub/ch1
Currently I'm likely able (and need) to achieve this by: 1) prefixing channel names in urls prior to url generation in php. So when clients request sub urls (they don't compose them by theirselves) or php app needs a pub url, I add prefixes to every id in the url. 2) prefixing channel names by nginx regexp internally. Like replacing /to /prefix_ in $ids. Not sure if this is possible at all.
What would you recommend?
— Reply to this email directly or view it on GitHubhttps://github.com/wandenberg/nginx-push-stream-module/issues/108 .
Cool, that seem exactly what I need. Are you planning to document this feature?
Yes. I'm updating the docs before the new release. This is why it wasn't released yet. ;)
On Wed, Nov 6, 2013 at 11:07 AM, Alexey Kupershtokh < notifications@github.com> wrote:
Cool, that seem exactly what I need. Are you planning to document this feature?
— Reply to this email directly or view it on GitHubhttps://github.com/wandenberg/nginx-push-stream-module/issues/108#issuecomment-27871589 .
Looking forward for the release :)
Hello. I would like to use nginx-push-stream-module with a few separate projects and would like them use intersecting channel names. But I want to make the them isolated somehow by identifying a bus they publish/subscribe. A configuration example would look something like defining two hosts in the same nginx:
In this theoretical example http://project1.myserver.com/sub-ev/ch1 would receive messages published to http://project1.myserver.com/pub/ch1 but not to http://project2.myserver.com/pub/ch1
Currently I'm likely able (and need) to achieve this by: 1) prefixing channel names in urls prior to url generation in php. So when clients request sub urls (they don't compose them by theirselves) or php app needs a pub url, I add prefixes to every id in the url. 2) prefixing channel names by nginx regexp internally. Like replacing
/
to/prefix_
in$ids
. Not sure if this is possible at all.What would you recommend?