bug with variables in fastcgi_pass

Samuel Vogel samydelux at gmail.com
Wed Dec 17 02:42:50 MSK 2008

Hey Igor,

I think I have hit a bug while trying out the feature you added in 0.7.27.

My config looks like this:
server {
    server_name _;
    access_log  /var/log/nginx/access.log;

    set $subdir "default";

    if ($host ~ "^(.+)\.user\.domain\.net$") {
        set $subdir $1;

    root   /www/$subdir;
    index  index.php index.html index.htm;
    location ~ \.php$ {
        fastcgi_pass   unix:/var/run/php-fpm/socket-$subdir;

And I get the following error:
[error] 17238#0: *1 no resolver defined to resolve 
/var/run/php-fpm/socket-345232, client:, server: _, request: 
"GET /info.php HTTP/1.1", host: "345232.user.domain.net"

If I remove the variable from fastcgi_pass everything works fine!
It seems like nginx is ignoring that I try to point it to a unix socket, 
when I use a variable!


More information about the nginx mailing list