Answer the question
In order to leave comments, you need to log in
How to configure nginx for how much php-fpm?
Good afternoon!
Problem essence: there are 2 servers. Main - nginx+php-fpm+mysql and additional (another physical server, but in 1 local network) - php-fpm
The idea is to redirect part of requests from specific urls to an additional one. Thus unloading the main.
#url который надо обработать на другом сервере
location /cms-new/task-manager {
try_files $uri index.php?$query_string @php-webhost;
}
location @php-webhost {
# include nginxconfig.io/php_fastcgi_webhost.conf;
include fastcgi_params;
fastcgi_index index.php;
fastcgi_buffers 8 32k;
fastcgi_buffer_size 64k;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_pass xxx.xxx.xxx.xxx:9000;
}
#Все остальные обрабатываем на основном
location / {
try_files $uri /index.php?$query_string;
}
location ~ \.php$ {
include nginxconfig.io/php_fastcgi.conf;
fastcgi_read_timeout 600;
}
location /cms-new/task-manager {
try_files $uri /index.php?$query_string @php-webhost;
}
location @php-webhost {
rewrite ^/(.*)$ /index.php?$1 break;
# root /home/user/project/public;
include fastcgi_params;
fastcgi_index index.php;
fastcgi_buffers 8 32k;
fastcgi_buffer_size 64k;
fastcgi_param SCRIPT_FILENAME /home/user/project/public$fastcgi_script_name;
#$realpath_root
fastcgi_pass xxx.xxx.xxx.xxx:9000;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question