Nginx http-bind proxy configuration

2,447 views
Skip to first unread message

Michael Weibel

unread,
Jun 1, 2012, 7:55:56 AM6/1/12
to str...@googlegroups.com
Hi all,

I'm now using nginx for proxying http-bind to the xmpp server's http-bind and currently I have the following configured:

location /http-bind/ {
proxy_pass http://xmpp1.demo.mila.com:5280/http-bind/; // or xmpp2, on each webserver should be a different one
proxy_buffering off;
tcp_nodelay on;
}

I encounter a lot of 504 Gateway timeouts and after googling I found this issue: https://support.process-one.net/browse/EJAB-1544 (I use ejabberd as well)

Does anyone know if the configuration mentioned there is the best way? I changed now to the following:

location /http-bind/ {
proxy_pass http://xmpp1.demo.mila.com:5280/http-bind/; // or xmpp2, on each webserver should be a different one
proxy_buffering off;
tcp_nodelay on;
proxy_read_timeout 120;
proxy_send_timeout 120;
proxy_connect_timeout 120;
}

I'm not quite sure if 120 is correct - maybe 70-80 would do it as well?
Also I'm unsure about proxy_buffering, tcp_nodelay and the other configurations mentioned in the linked issue:
proxy_buffer_size 8k;
proxy_buffers 8 32k;
proxy_busy_buffers_size 64k;
proxy_next_upstream off;

Would be cool if someone could share some hints :)

Thanks,
Michael


Theo Cushion

unread,
Jun 1, 2012, 9:05:39 AM6/1/12
to str...@googlegroups.com
We use:

location /http-bind/ {
proxy_buffering off;
tcp_nodelay on;
proxy_read_timeout 65;
proxy_connect_timeout 65;
proxy_pass http://localhost:5280/http-bind/;
}

Which seems to work (although now you've made me want to check there's no 504's slipping under the radar).

Theo

David Graham

unread,
Jun 2, 2012, 12:15:00 PM6/2/12
to str...@googlegroups.com
I documented an nginx proxy setup that's been working well here:

This isn't for ejabberd, but it might give you some ideas.

David

Michael Weibel

unread,
Jun 9, 2012, 10:26:16 AM6/9/12
to str...@googlegroups.com
Thanks David, that's very helpful :)
> --
> You received this message because you are subscribed to the Google Groups "Strophe" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/strophe/-/FKOP7_gt0eAJ.
> To post to this group, send email to str...@googlegroups.com.
> To unsubscribe from this group, send email to strophe+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/strophe?hl=en.

alex knol

unread,
Nov 26, 2014, 11:17:02 AM11/26/14
to str...@googlegroups.com
Just in case someone finds this thread:
 
In Ejabberd 14.07 (at least) the timeout I see is 5 minutes so Nginx should at least give it that long to respond. 
This is my configuration:
  location ~ ^/http-bind {
    proxy_pass            http://localhost:5280;
    proxy_set_header      Host $http_host;
    proxy_redirect        off;
    proxy_buffering       off;
    proxy_connect_timeout 5s;
    proxy_read_timeout    320s;
         tcp_nodelay                             on;
    keepalive_timeout     320s;
    send_timeout          320s;

  }


 
Reply all
Reply to author
Forward
0 new messages