Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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


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.