unix sockets are not reused when restarting nginx

Volodymyr Kostyrko arcade at b1t.name
Sun May 20 10:20:07 UTC 2018


Hello.

I'm using nginx 1.14.0 on FreeBSD 11-STABLE. I'm trying to get caching 
for internally generated content so I'm proxying nginx to nginx:

server {
         listen unix:/home/someuser/.media.nginx.sock;

         …
}

This perfectly works when starting nginx initially. However when 
restarting I sometimes get error reopening sockets to serve them:

nginx.error.log:2018/05/14 02:05:30 [emerg] 3583#0: bind() to 
unix:/home/someuser/.site.nginx.sock failed (48: Address already in use)
nginx.error.log:2018/05/14 02:05:30 [emerg] 3583#0: bind() to 
unix:/home/someuser/.site.nginx.sock failed (48: Address already in use)
nginx.error.log:2018/05/14 02:05:30 [emerg] 3583#0: bind() to 
unix:/home/someuser/.site.nginx.sock failed (48: Address already in use)
nginx.error.log:2018/05/14 02:05:30 [emerg] 3583#0: bind() to 
unix:/home/someuser/.site.nginx.sock failed (48: Address already in use)
nginx.error.log:2018/05/14 02:05:30 [emerg] 3583#0: bind() to 
unix:/home/someuser/.site.nginx.sock failed (48: Address already in use)

This can happen even on boot. Removing sockets allows nginx to start.

I also got this error:

error.log:2018/05/07 16:07:49 [notice] 89443#0: getsockopt(TCP_FASTOPEN) 
unix:/home/someuser/.site.nginx.sock failed, ignored (22: Invalid argument)

Thanks in advance.

-- 
Sphinx of black quartz judge my vow.


More information about the nginx mailing list