unix: in listen-directive

Aleksandar Lazic al-nginx at none.at
Sun Apr 8 23:36:34 MSD 2007


Hi,

in irc was the follwoing question:

can I also set nginx to listen on unix socket?

I have try this:

http{
server {
  listen       unix:/home/al/nginx.sock;
.
.
}
}

But I get a listen on a "random" inet port:

---
netstat -anp|egrep nginx
tcp        0      0 0.0.0.0:41825   0.0.0.0:*   LISTEN     29319/nginx
unix  3      [ ]         STREAM     CONNECTED     52464    29319/nginx
unix  3      [ ]         STREAM     CONNECTED     52463    29319/nginx
---
---
2007/04/08 21:34:30 [debug] 29318#0: bind() 0.0.0.0:0 #5 
2007/04/08 21:34:30 [notice] 29318#0: using the "epoll" event method
2007/04/08 21:34:30 [debug] 29318#0: counter: B7F98080, 1
2007/04/08 21:34:30 [notice] 29318#0: nginx/0.5.17
2007/04/08 21:34:30 [notice] 29318#0: built by gcc 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
2007/04/08 21:34:30 [notice] 29318#0: OS: Linux 2.6.18-4-686
2007/04/08 21:34:30 [notice] 29318#0: sysctl(KERN_RTSIGMAX): 0
2007/04/08 21:34:30 [notice] 29318#0: getrlimit(RLIMIT_NOFILE): 1024:1024
2007/04/08 21:34:30 [debug] 29319#0: write: 6, BF9ED8F6, 6, 0
2007/04/08 21:34:30 [debug] 29319#0: setproctitle: "nginx: master process sbin/nginx"
2007/04/08 21:34:30 [notice] 29319#0: start worker processes
2007/04/08 21:34:30 [debug] 29319#0: channel 6:7
2007/04/08 21:34:30 [notice] 29319#0: start worker process 29320
2007/04/08 21:34:30 [debug] 29319#0: sigsuspend
2007/04/08 21:34:30 [debug] 29320#0: malloc: 080BB600:6144
2007/04/08 21:34:30 [debug] 29320#0: malloc: B7BD4008:436800
2007/04/08 21:34:30 [debug] 29320#0: malloc: B7B91008:270400
2007/04/08 21:34:30 [debug] 29320#0: malloc: B7B4E008:270400
2007/04/08 21:34:30 [debug] 29320#0: epoll add event: fd:5 op:1 ev:00000001
2007/04/08 21:34:30 [debug] 29320#0: epoll add event: fd:7 op:1 ev:00000001
2007/04/08 21:34:30 [debug] 29320#0: setproctitle: "nginx: worker process"
2007/04/08 21:34:30 [debug] 29320#0: worker cycle
2007/04/08 21:34:30 [debug] 29320#0: epoll timer: -1
---

Was listen designed to listen on unix-socket?!

BR

Aleks





More information about the nginx mailing list