# Does the long polling module work with nginx 1.0.6?

**URL:** <https://www.ruby-forum.com/t/does-the-long-polling-module-work-with-nginx-1-0-6/212244>\
**Category:** NGINX\
**Created:** [September 26, 2011, 10:34pm UTC](https://www.ruby-forum.com/t/does-the-long-polling-module-work-with-nginx-1-0-6/212244 "2011-09-26T22:34:07Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [September 26, 2011, 10:34pm UTC](https://www.ruby-forum.com/t/does-the-long-polling-module-work-with-nginx-1-0-6/212244/1 "2011-09-26T22:34:07Z")

</div>

Hi,

I am using nginx with the long polling module. When 0.7 something was  
new, I compiled nginx with the long polling module and wrote my  
application. It ran under Ubuntu for 18 months or so, without problem.

During this time I have not changed the code that handles messages or  
startup. In fact, there are only two commits to the VCS.

About a month ago, I recompiled 1.0.6 with the long polling module using  
the same script as before. And the application has started to show  
intermittent errors.

Can anyone confirm that they are using the long-polling module with  
1.0.6 without problems?

The symptom appears to be that if the second person to join the chat  
room, does not send a message for 5 minutes and they do not receive one  
in this time either, then they get timed out, and never receive a reply  
to the read issued after the start-up phase.

Regards

Ian

---

<div class="post-metadata">

**Author:** ![dcian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/91b2a8/32.png) [@dcian](https://www.ruby-forum.com/u/dcian)\
**Post date:** [September 26, 2011, 10:59pm UTC](https://www.ruby-forum.com/t/does-the-long-polling-module-work-with-nginx-1-0-6/212244/2 "2011-09-26T22:59:26Z")

</div>

Are you referring to the push module? ([http://pushmodule.slact.net/](http://pushmodule.slact.net/))

Thomas

---

<div class="post-metadata">

**Author:** ![dcian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/91b2a8/32.png) [@dcian](https://www.ruby-forum.com/u/dcian)\
**Post date:** [September 26, 2011, 11:15pm UTC](https://www.ruby-forum.com/t/does-the-long-polling-module-work-with-nginx-1-0-6/212244/3 "2011-09-26T23:15:30Z")

</div>

On 26/09/2011 21:58, Thomas L. wrote:

> Are you referring to the push module? ([http://pushmodule.slact.net/](http://pushmodule.slact.net/))
> 
> Thomas

Yes - Version 0.69

---

<div class="post-metadata">

**Author:** ![dcian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/91b2a8/32.png) [@dcian](https://www.ruby-forum.com/u/dcian)\
**Post date:** [September 27, 2011, 6:52am UTC](https://www.ruby-forum.com/t/does-the-long-polling-module-work-with-nginx-1-0-6/212244/4 "2011-09-27T06:52:43Z")

</div>

Hi,

-------- Original-Nachricht --------

> Datum: Tue, 27 Sep 2011 00:10:40 +0200  
> Von: Thomas L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> An: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> Betreff: Re: Does the long polling module work with nginx 1.0.6?

> this server, so it’s insulated from any bad behaviour. I found the
> 
> > On 26/09/2011 21:58, Thomas L. wrote:  
> > [mailman.nginx.org archive](http://mailman.nginx.org/mailman/listinfo/nginx)
> 
> * * *
> 
> nginx mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [mailman.nginx.org archive](http://mailman.nginx.org/mailman/listinfo/nginx)

or have a look at wandenbergs nginx-push-module, since version 0.3.0  
(master branch) it also support long-polling and polling and its under  
active develpment.

> **[GitHub - wandenberg/nginx-push-stream-module: A pure stream http push technology for your Nginx...](https://github.com/wandenberg/nginx-push-stream-module)**
>
> A pure stream http push technology for your Nginx setup. Comet made easy and really scalable.

Cheers,

Elena

–  
NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!  
Jetzt informieren: [http://www.gmx.net/de/go/freephone](http://www.gmx.net/de/go/freephone)

---

<div class="post-metadata">

**Author:** ![dcian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/91b2a8/32.png) [@dcian](https://www.ruby-forum.com/u/dcian)\
**Post date:** [September 27, 2011, 8:42am UTC](https://www.ruby-forum.com/t/does-the-long-polling-module-work-with-nginx-1-0-6/212244/5 "2011-09-27T08:42:29Z")

</div>

Hello,

We are using the “Substitutions Filter module”  
to replace html content in our pages.

Our configuration is :

location /{  
subs\_filter\_types text/html text/xml;  
subs\_filter ‘[http://bale.hopla.net/bons-plans](http://bale.hopla.net/bons-plans)’  
‘[http://bons-plans.hopla.net](http://bons-plans.hopla.net)’;  
subs\_filter ‘id=“portal-logo” href=“[http://bale.hopla.net](http://bale.hopla.net)”’  
‘id=“portal-logo” href=“[http://www.hopla.net](http://www.hopla.net)”’;  
}

The first substitution is working, but the second not.  
Are we missing something? Is the “space” supported in substitution  
module?

Thank you for your help!

Martronic SA

nginx -V  
nginx: nginx version: nginx/1.1.4  
nginx: built by gcc 4.3.2 (Debian 4.3.2-1.1)  
nginx: TLS SNI support enabled  
nginx: configure arguments: --conf-path=/etc/nginx/nginx.conf  
–error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid  
–lock-path=/var/lock/nginx.lock  
–http-log-path=/var/log/nginx/access.log  
–with-http\_dav\_module --http-client-body-temp-path=/var/lib/nginx/body  
–with-http\_ssl\_module  
–http-proxy-temp-path=/var/lib/nginx/proxy  
–with-http\_stub\_status\_module  
–http-fastcgi-temp-path=/var/lib/nginx/fastcgi  
–add-module=/var/lib/substitutions4nginx-read-only

---

<div class="post-metadata">

**Author:** ![dcian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/91b2a8/32.png) [@dcian](https://www.ruby-forum.com/u/dcian)\
**Post date:** [September 28, 2011, 10:12am UTC](https://www.ruby-forum.com/t/does-the-long-polling-module-work-with-nginx-1-0-6/212244/6 "2011-09-28T10:12:27Z")

</div>

Can you show me your source page?

Thanks.

2011/9/27 Martronic SA [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![dcian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/91b2a8/32.png) [@dcian](https://www.ruby-forum.com/u/dcian)\
**Post date:** [September 27, 2011, 12:11am UTC](https://www.ruby-forum.com/t/does-the-long-polling-module-work-with-nginx-1-0-6/212244/7 "2011-09-27T00:11:02Z")

</div>

I put the push module into production for a while a few months ago and  
suffered intermittent segfaults. It also has a couple of design  
limitations that were problematic in my case. It doesn’t seem to be  
under active development, so I doubt these issues will be fixed any  
time soon.

But I wonder whether the module isn’t a poor solution architecturally,  
in any case. I eventually dropped it and implemented long-polling in a  
Node.js script. This turned out to be almost trivial – far faster  
than trying to fix the module. Nginx is set up as a reverse proxy to  
this server, so it’s insulated from any bad behaviour. I found the  
stability and ease of maintenance of this design easily worth the  
extra ~50 MB and CPU cycles.

Cheers  
Thomas

---

<div class="post-metadata">

**Author:** ![dcian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/91b2a8/32.png) [@dcian](https://www.ruby-forum.com/u/dcian)\
**Post date:** [September 28, 2011, 11:43am UTC](https://www.ruby-forum.com/t/does-the-long-polling-module-work-with-nginx-1-0-6/212244/8 "2011-09-28T11:43:09Z")

</div>

full source attachment  
Thanks.

[![Logo](http://bale.hopla.net/portal_logo/image "Logo Hopla-Net")](http://bale.hopla.net)

```
      <div style="position:relative; display: block" 

```

id=“carousel-banner-0”  
class=“bando.jpg carousel-banner selected”\>

  

```
      <div style="display: none" id="carousel-banner-1" 

```

class=“bandeauhoplabale.jpg  
carousel-banner”\>

  

```
    <span class="bandeauTopLeft"></span>

    <span class="bandeauTopRight"></span>
    <span class="bandeauBottomLeft"></span>
    <span class="bandeauBottomRight"></span>
</div>

```

> > The first substitution is working, but the second not.  
> > nginx: configure arguments: --conf-path=/etc/nginx/nginx.\*\*conf
> > 
> > \_\_\_\_\_\_\_\_\_\_\_\_\__ **\*\*** _  
> > nginx mailing list  
> > [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

[mailman.nginx.org archive](http://mailman.nginx.org/**mailman/listinfo/nginx)[http://mailman.nginx.org/mailman/listinfo/nginx](http://mailman.nginx.org/mailman/listinfo/nginx)

> > 
> 
> * * *
> 
> nginx mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [mailman.nginx.org archive](http://mailman.nginx.org/mailman/listinfo/nginx)

Avec nos meilleures salutations,

MARTRONIC SA

De votre site internet  
votre serveur dapplications  
Venez visiter notre nouvelle plateforme collaborative Web 2 de Martronic

> **[Site en construction](http://www.solgema.com)**

[http://www.solgema.ch](http://www.solgema.ch)

> **[Martronic SA, Services de gestion & internet](https://www.martronic.ch)**

Rue du Chteau-Vieux 12  
Case postale 186  
1870 Monthey VS  
Suisse / Switzerland

Tl +41 24 471 51 07  
Fax +41 24 471 58 47  
e-mail : [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![dcian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/91b2a8/32.png) [@dcian](https://www.ruby-forum.com/u/dcian)\
**Post date:** [September 29, 2011, 11:47pm UTC](https://www.ruby-forum.com/t/does-the-long-polling-module-work-with-nginx-1-0-6/212244/9 "2011-09-29T23:47:08Z")

</div>

It works in my box. Can you show me your debug log?

[http://wiki.nginx.org/Debugging](http://wiki.nginx.org/Debugging)

Do’t use this in the production server. The debug log will be very  
large.

2011/9/28 Martronic SA [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![dcian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/91b2a8/32.png) [@dcian](https://www.ruby-forum.com/u/dcian)\
**Post date:** [September 30, 2011, 5:27am UTC](https://www.ruby-forum.com/t/does-the-long-polling-module-work-with-nginx-1-0-6/212244/10 "2011-09-30T05:27:36Z")

</div>

Sorry. I can’t find any log from my substitutions module in your debug  
log.

And I find the possible problem. The response from backend server is  
gzipped. You can compress the response with Nginx’s gzip module.

You should disable the gzipped response from backend server, like this:

proxy\_set\_header Accept-Encoding “”;

2011/9/29 Martronic SA [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![dcian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/91b2a8/32.png) [@dcian](https://www.ruby-forum.com/u/dcian)\
**Post date:** [September 30, 2011, 11:11am UTC](https://www.ruby-forum.com/t/does-the-long-polling-module-work-with-nginx-1-0-6/212244/11 "2011-09-30T11:11:20Z")

</div>

2011/9/29 Ҧΰ [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Sorry. I can’t find any log from my substitutions module in your debug log.  
> And I find the possible problem. The response from backend server is  
> gzipped.

Maybe we could check the Content-Encoding response header  
automatically in ngx\_subs and if it’s gzip/deflate, just issue a  
warning to error.log by default? 😉

Regards,  
-agentzh

---

<div class="post-metadata">

**Author:** ![dcian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/91b2a8/32.png) [@dcian](https://www.ruby-forum.com/u/dcian)\
**Post date:** [September 30, 2011, 11:22am UTC](https://www.ruby-forum.com/t/does-the-long-polling-module-work-with-nginx-1-0-6/212244/12 "2011-09-30T11:22:29Z")

</div>

Maybe the documentation of the module should be completed to notify  
about  
this problem.

Thanks!

Martronic SA

Le 29.09.2011 18:08, agentzh a crit :

---

<div class="post-metadata">

**Author:** ![dcian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/91b2a8/32.png) [@dcian](https://www.ruby-forum.com/u/dcian)\
**Post date:** [September 30, 2011, 7:14am UTC](https://www.ruby-forum.com/t/does-the-long-polling-module-work-with-nginx-1-0-6/212244/13 "2011-09-30T07:14:58Z")

</div>

hi

thank you very much for your help.  
yes it was the gzip problematic.  
maitenent it works great

Thanks  
Martial

---

<div class="post-metadata">

**Author:** ![dcian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/91b2a8/32.png) [@dcian](https://www.ruby-forum.com/u/dcian)\
**Post date:** [October 8, 2011, 4:36am UTC](https://www.ruby-forum.com/t/does-the-long-polling-module-work-with-nginx-1-0-6/212244/14 "2011-10-08T04:36:41Z")

</div>

Yes, You are right. I’ll add this to the documents. There will be too  
much  
error log if I add this for each request.

2011930 4:52Martronic SA [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)д

---

<div class="post-metadata">

**Author:** ![dcian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/91b2a8/32.png) [@dcian](https://www.ruby-forum.com/u/dcian)\
**Post date:** [October 8, 2011, 4:45am UTC](https://www.ruby-forum.com/t/does-the-long-polling-module-work-with-nginx-1-0-6/212244/15 "2011-10-08T04:45:56Z")

</div>

2011/10/8 Ҧΰ [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Yes, You are right. I’ll add this to the documents. There will be too much  
> error log if I add this for each request.

You can just log at the debug level maybe? 😉

Regards,  
-agentzh

---

<div class="post-metadata">

**Author:** ![dcian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/91b2a8/32.png) [@dcian](https://www.ruby-forum.com/u/dcian)\
**Post date:** [October 8, 2011, 7:55am UTC](https://www.ruby-forum.com/t/does-the-long-polling-module-work-with-nginx-1-0-6/212244/16 "2011-10-08T07:55:02Z")

</div>

Thanks. I have added the log. Hope this can be helpful.

2011108 10:45agentzh [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)д
