Есть сайт mydomain.com. На поддомене (rpl.mydomain.com) установлен
dklab_realplexor
/etc/dklab_realplexor.conf
$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>
Скрипт шлет такие запросы:
rpl.mydomain.com/?identifier=test_Alpha&ncrnd=1431... ответ на которые не приходит, и по истечении 1 минуты, запрос обрывается и открывается новый.
Если перейти по этой ссылке вручную, через минуту я получаю чистый лист..
При запросе скрипта (rpl.mydomain.com/?identifier=SCRIPT), все отлично
Если открыть rpl.mydomain.com напрямую, через минуту получаю 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]
# Проверяем, что Realplexor доступен: если соединене
# перешло в режим ожидания, то все OK.
[root@plipclick ~]# 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.
Почему так? В какую сторону копать?