I am trying to do the following:
I have 2 docker php-fpm(no nginx) containers with the same directory structure but with different versions of code. Now I have another container with nginx in it.
When the requests goes to foo.com/ it should go to the first container and when the request goes to foo.com/v11/ it should go to the second container.
The problem is it doesn't work for the second scenario. ie when the request goes to foo.com/v11/, it simply won't go to the php-fpm server. relevant parts of the config file is below:
location / {
try_files $uri $uri/ /index.php?$query_string;
location ~ \.php$ {
fastcgi_pass php_wbv1.0:5000;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
include fastcgi_params;
}
}
location /v11/ {
rewrite ^\/v11\/(.*)$ /$1 break;
try_files $uri $uri/ /v11/index.php?$query_string;
location ~ \.php$ {
fastcgi_pass php_wbv1.1:5001;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
include fastcgi_params;
}
}
Can somebody tell why its not working?