1

debian stable, nginx version: nginx/1.14.2

I get the following error message (error.log) : connect() failed (91: Protocol wrong type for socket)

configuration file :

access_log syslog:server=unix:/var/log/nginx/test.sock;

extra info:

  • I listen to socket like so: socat - unix-listen:/var/log/nginx/test.sock
  • I have made sure nginx has sufficient access rights to write (chmod 777 for testing)
  • logging to UDP & TCP works fine
  • selinux is disabled by default in debian stable
Nozz
  • 13
  • 2
  • How did you configure your syslog server to listen on this socket? – Michael Hampton Dec 30 '20 at 16:46
  • 1
    `access_log` may be trying to open a datagram socket. I notice that `unix-listen` creates a "UNIX domain stream socket". You could try using one of the address types that create a "UNIX domain datagram socket". – Richard Smith Dec 30 '20 at 16:51
  • @MichaelHampton, I didn't, like I wrote, using socat to listen to the socket. – Nozz Dec 30 '20 at 19:10
  • @RichardSmith, thank you Richard, that was it. I switched to unix-recv and it worked like a charm. Please feel free to post an answer and I will accept it. – Nozz Dec 30 '20 at 19:15

0 Answers0