Nginx request subset to different pool

I have an nginx server with some requests that are slower and as such could saturate a PHP FPM pool. I don't mind if these requests get dropped and also more importantly they don't affect the normal requests.

I thought that I could create another limited PHP-FPM pool for these requests and I have done this but am struggling with the nginx side of things.

My current config looks like...

location ~ \.php$ {
        include snippets/fastcgi-php.conf;

        # With php7.0-fpm:
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }

What I want to happen is that any request to certain explicit paths such as /test/update.php to go to another pool with the address of fastcgi_pass unix:/run/php/php7.0-fpm-secondary.sock;.

Is this possible?

1
задан 1 March 2017 в 15:45
1 ответ

Это может сделать то, что вы ищете, но это не проверено.

location ~ /test/update.php$ {
    include snippets/fastcgi-php.conf;
    fastcgi_pass unix:/run/php/php7.0-fpm-secondary.sock;
}
0
ответ дан 4 December 2019 в 05:08

Теги

Похожие вопросы