Project

General

Profile

I am using xmpp server and i am getting intermediate 502 error code from nginx log "upstream prematurely closed connection while reading response header from upstream http://xxx.xxx.xxx.xxx:5280/http-bind"

shailesh j
Added almost 4 years ago

Issue-1

Issue-2

Issue-1

I'm having difficulty getting nginx to proxy to an xmpp server using a BOSH connection. I get intermediate below error in the logs

error logs of nginx: ##2015/04/01 14:15:54 [error] 21788#0: *225307 upstream prematurely closed connection while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: exampledev.in, request: "POST /http-bind HTTP/1.1", upstream: "http://xxx.xxx.xxx.xxx:5280/http-bind", host: "example.in", referrer: "http://test1.example.in/exampleqa/chat/default/index" ##

access log of nginx: ##27.106.72.217 - - [01/Apr/2015:14:15:54 +0530] "POST /http-bind HTTP/1.1" 502 568 "http://test1.example.in/exampleqa/chat/default/index" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.104 Safari/537.36"

Importan

nginx file: nginx.conf and vhost_default.

tigase file: tigase.conf and init.properties.

Note:

1)I am using ubuntu OS system --> version Ubuntu 14.04.1 LTS" in both nginx server and xmpp server.

2)All user request come to nginx server then nginx forward (proxy pass) connection to xmpp server.

3)web server configuration:- Amazone Ec2 instance t2.small, Virual CPU:1, Ram:2GB

4)Xmpp server configuration: Amazone Ec2 instance t2.micro, Virual CPU:1, Ram:1GB

Few request failed in 502 error code and print above mentioned error log.

Kindly find attached my nginx and tigase configuration files.

Issue-2

I have facing a problem with My RDS. most of tigase user connection goes in to sleep mode. how to resolve this.

mysql> show full processlist;
+-------+------------+---------------------------------------------+----------+---------+------+-------------+-----------------------+
| Id    | User       | Host                                        | db       | Command | Time | State       | Info                  |
+-------+------------+---------------------------------------------+----------+---------+------+-------------+-----------------------+
| 77179 | tigase     | ip-xx-xx-xx-xx.ip.secureserver.net:45595    | tigasedb | Sleep   |  581 |             | NULL                  |
| 79925 | rdsadmin   | localhost:31957                             | mysql    | Sleep   |    2 |             | NULL                  |
| 82115 | exp-tigase | xx.xx.xx.xx:52266                           |tigasedb  | Sleep   |   32 |             | NULL                  |
| 82123 | exp-tigase | xx.xx.xx.xx:52274                           | tigasedb | Sleep   |   28 |             | NULL                  |
| 89876 | tigase     | ip-xx-xx-xx-xx.ip.secureserver.net:48205    | tigasedb | Sleep   | 4675 |             | NULL 



nginx.conf (2.29 KB) nginx.conf nginx configurtion file
tigase.conf (774 Bytes) tigase.conf tigase configuraion file
init.properties (2.01 KB) init.properties tigase property file
vhost_default (2.11 KB) vhost_default nginx vhost

Replies (8)

Added by shailesh j almost 4 years ago

Hi team,

Please help me to sort out this issue.

Regards,

Shaileshj

Added by Wojciech Kapcia TigaseTeam almost 4 years ago

Please try following configuration:

    location /http-bind {
            proxy_pass  http://xmpp.exampledev.in:5280/http-bind;
            tcp_nodelay on;
            keepalive_timeout 55;
        proxy_buffering off;
        }

Added by shailesh j almost 4 years ago

Hello Wojciech,

Thanks for replying. I made changes as suggested by you but unfortunately still facing same problem. please suggest.

Added by Wojciech Kapcia TigaseTeam almost 4 years ago

OK, as the log indicates Tigase closes connection for some reason, and without any excerpt from logs (mostly Tigase) it's hard to tell why it behaves like that. Please recreate the issue with debugging enabled in Tigase and cleared logs (@--debug=server,xmpp.impl,net,io,bosh@) and check those logs for entries with closing the connection.

Added by shailesh j almost 4 years ago

Hello Wojciech,

I have added above setting on my tigase configuration. Kindly find attached tigase log.

Recent nginx logs

Accesslog:

27.106.72.217 - - [28/Apr/2015:16:29:31 +0530] "POST /http-bind HTTP/1.1" 502 166 "http://sameertastebuds.exampledev.in/c360qa/chat/default/index" "Mozilla/5.0 (Windows NT 6.2; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0"

errorlog:

2015/04/28 16:29:31 [error] 30314#0: *200610 upstream prematurely closed connection while reading response header from upstream, client: XXX.XXX.XXX.XXX, server: exampledev.in, request: "POST /http-bind HTTP/1.1", upstream: "http://XXX.XXX.XXX.XXX:5280/http-bind", host: "exampledev.in", referrer: "http://sameertastebuds.exampledev.in/c360qa/chat/default/index"

tigaselog (8.5 KB) tigaselog

Added by shailesh j almost 4 years ago

please help.

Added by shailesh j almost 4 years ago

Hello Wojciech,

Please help me.

Added by Wojciech Kapcia TigaseTeam almost 4 years ago

shailesh j wrote:

Hello Wojciech,

I have added above setting on my tigase configuration. Kindly find attached tigase log.

Those logs don't look like Tigase logs. Please attach (compressed!) logs/tigase.log.x (where x is subsequent integer)

    (1-8/8)