How to use abstract names of unix domain sockets with fastcgi in nginx?

Weber K. asked:

I tried some perl examples of unix domain sockets using abstract names:
Created a socket starting with a null character:

my $socket_path = "wibble";

using netstat -nlp I can see the socket:

unix  2      [ ACC ]     STREAM     LISTENING     309510   3448/perl            @wibble

In examples all is working, but…
I want to use fastCGI in nginx with unix domain sockets using abstract names:

So in nginx.conf:

Using       fastcgi_pass  "/tmp/wibble"; #is Ok
But using       fastcgi_pass  "unix:Any_name"; #is not Ok!!

I tried wibble zwibble x{0}wibble and it didnt work!

At fastcgi-wrapper.pl I tried:

Using        $socket = FCGI::OpenSocket( "/tmp/wibble", 10 ); #is Ok
But using       fastcgi_pass  "unix:Any_name"; #is not Ok!!

I tried wibble zwibble x{0}wibble and it didnt work!

BTW: I want to use chroot on nginx and chroot in perl, so I cannot use a filesystem socket, as it will be a path out of jail and a security flaw…

My answer:


nginx doesn’t support abstract sockets (as of today). However an unofficial patch exists which provides this support. Once applied, you can refer to an abstract socket as @wibble. If you use this patch, be sure to read the entire nginx forum thread regarding it, as it refers to various changes made to the patch.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.