E
E
entermix2015-05-17 15:22:48
linux
entermix, 2015-05-17 15:22:48

What's wrong with dklab_realplexor?

There is a site mydomain.com. Subdomain (rpl.mydomain.com) has dklab_realplexor /etc/dklab_realplexor.conf
installed

$CONFIG{WAIT_ADDR} = [ '127.0.0.1:8088' ]; # your IP address and port
$CONFIG{IN_ADDR} = [ '127.0.0.1:10010' ]; # for IN line
return 1;

/etc/nginx/vhosts/mydomain/rpl.mydomain.com.conf
#user 'mydomain' virtual host 'rpl.mydomain.com' configuration file
server {
  server_name rpl.mydomain.com www.rpl.mydomain.com;
  
  listen MYDOMAIN_IP_ADDRESS:80;
  
  location / {
    proxy_pass http://127.0.0.1:8088;
  }
}

rpl.mydomain.com, index.php:
include_once('Realplexor.php');
$realplexor = new DklabRealplexotr('127.0.0.1', '10010', 'test_');
$realplexor->send(array('Alpha'), 'hi!');

mydomain.com:
<script type="text/javascript" src="http://rpl.mydomain.com/?identifier=SCRIPT&<?=time()?>"></script>
<script type="text/javascript">
    $(function () {
        var realplexor = new Dklab_Realplexor('http://rpl.mydomain.com/', 'test_');
        realplexor.subscribe("Alpha", function(data) { alert("Alpha: " + data) });
        realplexor.execute();

    });
</script>

The script sends the following requests: rpl.mydomain.com/?identifier=test_Alpha&ncrnd=1431... to which no response is received, and after 1 minute, the request is terminated and a new one is opened.
If I follow this link manually, after a minute I get a blank page.
When I request a script (rpl.mydomain.com/?identifier=SCRIPT), everything is fine
If I open rpl.mydomain.com directly, after a minute I get 504 Gateway Time-out
/var/log/messages
May 17 14:54:34 mydomain realplexor/dklab_realplexor.conf: [Sun May 17 14:54:34 2015] SIGHUP received, reloading the config
May 17 14:54:34 mydomain realplexor/dklab_realplexor.conf:   [pairs_by_fhs=0 data_to_send=0 connected_fhs=0 online_timers=0 cleanup_timers=0 events=4]
May 17 14:54:34 mydomain realplexor/dklab_realplexor.conf: [Sun May 17 14:54:34 2015] CONFIG: appending configuration from /etc/dklab_realplexor.conf
May 17 14:54:34 mydomain realplexor/dklab_realplexor.conf:   [pairs_by_fhs=0 data_to_send=0 connected_fhs=0 online_timers=0 cleanup_timers=0 events=4]
May 17 14:57:49 mydomain realplexor/dklab_realplexor.conf: [Sun May 17 14:57:49 2015] WAIT: 127.0.0.1:47080: DEBUG: connection opened
May 17 14:57:49 mydomain realplexor/dklab_realplexor.conf:   [pairs_by_fhs=0 data_to_send=0 connected_fhs=0 online_timers=0 cleanup_timers=0 events=4]
May 17 14:57:49 mydomain realplexor/dklab_realplexor.conf: [Sun May 17 14:57:49 2015] WAIT: 127.0.0.1:47080: DEBUG: read 419 bytes
May 17 14:57:49 mydomain realplexor/dklab_realplexor.conf:   [pairs_by_fhs=0 data_to_send=0 connected_fhs=0 online_timers=0 cleanup_timers=0 events=4]
May 17 14:57:49 mydomain realplexor/dklab_realplexor.conf: [Sun May 17 14:57:49 2015] WAIT: 127.0.0.1:47080: DEBUG: SCRIPT marker received, sending content
May 17 14:57:49 mydomain realplexor/dklab_realplexor.conf:   [pairs_by_fhs=0 data_to_send=0 connected_fhs=0 online_timers=0 cleanup_timers=0 events=4]
May 17 14:57:49 mydomain realplexor/dklab_realplexor.conf: [Sun May 17 14:57:49 2015] WAIT: 127.0.0.1:47080: DEBUG: connection closed
May 17 14:57:49 mydomain realplexor/dklab_realplexor.conf:   [pairs_by_fhs=0 data_to_send=0 connected_fhs=0 online_timers=0 cleanup_timers=0 events=4]
May 17 14:57:50 mydomain realplexor/dklab_realplexor.conf: [Sun May 17 14:57:50 2015] WAIT: 127.0.0.1:47165: DEBUG: connection opened
May 17 14:57:50 mydomain realplexor/dklab_realplexor.conf:   [pairs_by_fhs=0 data_to_send=0 connected_fhs=0 online_timers=0 cleanup_timers=0 events=4]
May 17 14:57:50 mydomain realplexor/dklab_realplexor.conf: [Sun May 17 14:57:50 2015] WAIT: 127.0.0.1:47165: DEBUG: read 539 bytes
May 17 14:57:50 mydomain realplexor/dklab_realplexor.conf:   [pairs_by_fhs=0 data_to_send=0 connected_fhs=0 online_timers=0 cleanup_timers=0 events=4]
May 17 14:57:50 mydomain realplexor/dklab_realplexor.conf: [Sun May 17 14:57:50 2015] WAIT: 127.0.0.1:47165: DEBUG: [1431863870.13777003900000:test_Alpha] registered
May 17 14:57:50 mydomain realplexor/dklab_realplexor.conf:   [pairs_by_fhs=1 data_to_send=0 connected_fhs=1 online_timers=1 cleanup_timers=0 events=5]

# Check that the Realplexor is available: if the connection
# went to standby mode, then everything is OK.

[[email protected] ~]# wget http://rpl.mydomain.com
--2015-05-17 15:17:56--  http://rpl.mydomain.com/                                                                            
Resolving rpl.mydomain.com... 62.109.22.139                                                                                  
Connecting to rpl.mydomain.com|62.109.22.139|:80... connected.                                                               
HTTP request sent, awaiting response...   
2015-05-17 15:18:56 ERROR 504: Gateway Time-out.

Why is that? In which direction to dig?

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
E
entermix, 2015-05-17
@entermix

include_once('Realplexor.php');
$realplexor = new DklabRealplexotr('127.0.0.1', '10010', 'test_');
$realplexor->send(array('Alpha'), 'hi!');

Must run on mydomain.com, not rpl.mydomain.com!

S
Sergey, 2015-05-17
@Weidmann

Have you tried increasing the timeouts?
nginx.org/ru/docs/http/ngx_http_proxy_module.html#...
nginx.org/ru/docs/http/ngx_http_proxy_module.html#...
nginx.org/ru/docs/http/ngx_http_proxy_module.html#.. .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question