use different fastcgi backend in different folder

Igor Sysoev is at rambler-co.ru
Mon Sep 1 09:00:10 MSD 2008


On Mon, Sep 01, 2008 at 12:57:05AM +0200, Samuel Vogel wrote:

> I am wondering how I can tell nginx to use a different fastcgi backend 
> for my phpmyadmin subfolder /pma.
> This is what I did:
> 
>        location ~ /pma/.+\.php$ {
>                fastcgi_pass   127.0.0.1:9001;
>        }
> 
>        location ~ \.php$ {
>                fastcgi_pass   127.0.0.1:9000;
>        }
> 
> The php backend on port 9001 is chrooted to the /pma folder. The problem 
> is, that $fastcgi_script_name now contains the /pma, so the php backend 
> can't find the right file.
> How can I strip of the /pma from $fastcgi_script_name.
> 
> I don't want to make another virtual host, since I don't want a seperate 
> port or subdomain just for phpmyadmin. Is a seperate vhost really the 
> only way to go?

Try the following:

        location ~ /pma/.+\.php$ {
                rewrite  ^/pma(/.+)$  $1  break;

                fastcgi_pass   127.0.0.1:9001;
        }


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list