How to process Facebook signed request to determine proxy target?

Hello all,

we’re using a Nginx as proxy gateway to several customer specific apache
instances on different servers.

In order to determine where to route the traffic from a Facebook
application, we need to extract the page id from the Facebook signed
( and
look up its respective target apache instance in a table (probably from

As I don’t have much experience with Nginx yet, I’d like to ask for your
feedback on some theoretical solutions I’ve come up with:

  1. Extract the signed request from the POST data with the
    HttpFormInputModule or HttpLuaModule and use HttpMemcModule for
    interactions with memcached.

From my understanding, this whole operation could be defined in the
nginx.conf or site.conf file then, which is favorable, but I haven’t
found out yet if I’d be actually be able to decode the signed request
for processing. Is there maybe another third party module available for

  1. Use the EmbeddedPerlModule, which is still in experimental stage as I
    understand, and write a perl script similar to the php script posted on
    the Facebook link above to retrieve the required page id value. Then
    access memcached from within the script or with the HttpMemcModule.

  2. Write my own Nginx module.

What would you suggest is the best way to go about this or do you maybe
have better solutions?


Posted at Nginx Forum:,222397,222397#msg-222397

Hi Ralf,

I’m currently working on a similar functionality. Have you managed to
find a


Posted at Nginx Forum:,222397,242728#msg-242728

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs