wandenberg / nginx-push-stream-module

A pure stream http push technology for your Nginx setup. Comet made easy and really scalable.
Other
2.22k stars 295 forks source link

Custom 404 / channel inactive message #200

Closed ajnsn closed 3 years ago

ajnsn commented 9 years ago

To identify inactive channels, we currently look for push stream's 404 responses on the publish location. To better debug our application, we would like to distinguish normal 404's from channels with no subscribers.

We tried a custom 404 to a internal location, e.g. error_page 404 @404 but push stream module seems to ignore it and still returns its own 404?

Thanks!

wandenberg commented 9 years ago

@ajnsn can you give more details about how are you using the module?

Take a look if the events channel can help you achieve your goal.

ajnsn commented 9 years ago

@wandenberg Thank you for your reply. We currently evaluating your module to have a push mechanism between our backend and application. The subscribers receive their own individual (secure) channel or subscribe to one of the public channels.

In the backend you typically initiate a control message, and a command is going over the channel, like "please fetch something from url".

To better analyze if a channel is currently active, we currently pull the stats of the channel from the module. As the module location is a configuration option, we want to make sure that the backend is really receiving a response from your module. If we receive a 404, we can only assume that it's a configured "push server" with an empty channel but we do not really know it.

So my idea was to have a custom 404 message within the stats and publish location which replies with an empty json array (subscribers: 0). Unfortunately it does not work :)