Welcome! Log In Create A New Profile

Advanced

Combining Rails and nginx_push_module

December 02, 2009 03:34AM
Hi,

I am trying to combine a Rails & Thin configuration with the nginx push module. I have these two config snippets:

Rails & Thin:

[code]
upstream thin {
server 127.0.0.1:8000;
server 127.0.0.1:8001;
server 127.0.0.1:8002;
}

server {
listen 80;
server_name localhost;
access_log /var/log/nginx/localhost.access.log;
root /var/www/test/public;

location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect false;
if (-f $request_filename/index.html) {
rewrite (.*) $1/index.html break;
}
if (-f $request_filename.html) {
rewrite (.*) $1.html break;
}
if (!-f $request_filename) {
proxy_pass http://thin;
break;
}
}
}
[/code]


Nginx Push Module

[code]
# internal publish endpoint (keep it private / protected)
location /publish {
set $push_channel_id $arg_id; #/?id=239aff3 or somesuch
push_publisher;

push_store_messages on; # enable message queueing
push_message_timeout 2h; # expire buffered messages after 2 hours
push_max_message_buffer_length 10; # store 10 messages
push_min_message_recipients 0; # minimum recipients before purge
break;
}

# public long-polling endpoint
location /activity {
push_subscriber;

# how multiple listener requests to the same channel id are handled
# - last: only the most recent listener request is kept, 409 for others.
# - first: only the oldest listener request is kept, 409 for others.
# - broadcast: any number of listener requests may be long-polling.
push_subscriber_concurrency broadcast;
set $push_channel_id $arg_id;
default_type text/plain;
break;
}
[/code]


But when I insert the push module code the requests for "publish" and "activity" still are handeled by Rails.

How would you solve that?


Regards,

Elias
Subject Author Posted

Combining Rails and nginx_push_module

saile December 02, 2009 03:34AM

Re: Combining Rails and nginx_push_module

saile December 02, 2009 12:04PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 247
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready