Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

my workflow is following:

  • accept request
  • with ruby script do some stuff
  • send x-accel-redirect header and return
  • ... client receives data ...
  • client disconnected
  • <- here I would like to run some script

What I need: some http headers from client and headers sent by initial script.

My first idea was to parse logs, but it can break really easily. Other option would be force nginx to log to some custom daemon or to socket. Or use some callback after end of x-accel-redirect request.

Question is: Is it possible to setup nginx (without any patch) use as log: syslog, custom daemon, socket or some daemon reading from fake file. Or setup some callback after request?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You want post_action. Be careful where you put it, though, I believe it can recurse.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.