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

I need to setup centralized remote access logging of Auto Scaling Instances. Currently I have Rsyslog / Apache2 logging working just fine, but for the new project Nginx is used and I don't see any possibility to log directly over TCP/UDP. Rsyslog can be configured to send data remotely reading local file, but my goal is to avoid local writes at all.

Can someone share the knowledge on how to configure Nginx to send messages over Network instead of local FS? Or maybe I might need to configure log rotation to scp files?

share|improve this question
up vote 3 down vote accepted

Create a FIFO (pipe), tell nginx to log to that, and have your syslog daemon read the FIFO and send those messages to a remote location. Both rsyslog and syslog-ng can do this.

share|improve this answer
In this case, why not just let Nginx to log to default file and then use Rsyslog to read and send it remotely? What is the benefit of FIFO? – Roman Newaza Jun 26 '12 at 11:24
Because you said you wanted to avoid local writes. A FIFO doesn't write to disk, it's just a small chunk of memory that buffers writes. – womble Jun 26 '12 at 11:33
You are right! Thanks a lot! – Roman Newaza Jun 27 '12 at 1:24

You can try the nginx_udplog_module. It looks like it hasn't been updated in a while, but it may still work.

share|improve this answer
Also nice solution - thank you! – Roman Newaza Jun 27 '12 at 1:25

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.