192.168.55.115 Primary Server
192.168.55.185 is from server
You need to split the request sent to the server side, as follows
Require/index.php/* requests to access the primary server
/api.php/1/files/* request access to the primary server
/api.php/1/files_put/* request access to the primary server
/api.php/1/thumbnails/* request access to the primary server
/statics/thumbnails/* request access to the primary server
Everything else is accessed from the server
Server configuration for Primary server 192.168.55.115
Upstream Follower {server 192.168.55.185:80 max_fails=5 fail_timeout=360s;}
server {Listen 80;
server_name 192.168.55.115;
Index index.html index.htm index.php;
Root/www/web/sign_name;
Client_max_body_size 10240m;
Location ~ ^/index\.php\w*|/api\.php/\d+/(\bfiles\b|\bfiles_put\b|\bthumbnails\b)/\w* {set $script $uri;
Set $path _info "";
if ($uri ~ "^ (. +.php) (/.+)") {set $script $;
Set $path _info $;
} Fastcgi_pass 127.0.0.1:9000;
Fastcgi_index index.php;
Fastcgi_param Script_filename/www/web/sign_name$fastcgi_script_name;
Include Fastcgi_params;
Fastcgi_param Script_name $script;
Fastcgi_param path_info $path _info; } location ~ ^/statics/thumbnails/\w* {} location/{Proxy_pass http://follower;
Proxy_set_header Host $http _host;
Proxy_next_upstream error timeout Invalid_header http_500;
Proxy_connect_timeout 360s; #rewrite ^ (. *?)
api.php/(. *) $ $1api.php?$2; #rewrite ^ (. *?)
index.php/(. *) $ $1index.php?$2; }
}
which
Set $script $uri;
Set $path _info "";
if ($uri ~ "^ (. +.php) (/.+)") {
set $script $;
Set $path _info $
}
The setup is to configure PHP's $_server[' path_info '] to get the full path problem, please refer to here
Server configuration from 192.168.55.185
server {
listen ;
server_name 192.168.55.185;
Index index.html index.htm index.php;
Root/www/web/sign_name;
Client_max_body_size 10240m;
Location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
Fastcgi_index index.php;
Fastcgi_param script_filename /www/web/sign_name$fastcgi_script_name;
Include fastcgi_params;
}
Location/{
rewrite ^ (. *?) api.php/(. *) $ $1api.php?$2;
Rewrite ^ (. *?) index.php/(. *) $ $1index.php?$2;
}
}