News for hackers. Stuff that matters.
Re:Nginx module to turn it into a long-polling message queui... by simonw on Friday October 16, 2009 @02:53PM (#885962)
Quick question for any nginx experts: the following config setting:

set $push_channel_id $arg_id; #/?id=239aff3 or somesuch

Means that the ?id= querystring paramater is used as the push channel ID. Any idea if it would be possible to set it up so /channel/12345/ would result in 12345 being set as the push channel ID?

Re:Nginx module to turn it into a long-polling message queui... by wizard_2 on Friday October 16, 2009 @03:53PM (#886048)
Quite possible - You'd need to use the rewrite module to pass it as an argument. http://wiki.nginx.org/NginxHttpRewriteModule

Maybe something like this...

  location / {
    rewrite  ^/channel/(.+)$ /channel/?id=$1 last;
  }
  
  location /channel/{
    #stuff
    set $push_channel_id $arg_id; #/?id=239aff3 or somesuch
  }