1

Looking for a way to access PHP7-FPM in an LXC container and PHP5-FPM in an other while NGINX is installed on the host. The idea is to serve https://www.example.com/ with PHP7 and https://www.example.com/old/ with PHP5.

Here is my conf for NGINX:

    location ~ /old/\.php$ {
    try_files $uri =404;
    fastcgi_intercept_errors on;
    fastcgi_index  index.php;
    include        fastcgi_params;
    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    fastcgi_pass   192.168.0.10:9000;
}


location ~ \.php$ {
    try_files $uri =404;
    fastcgi_intercept_errors on;
    fastcgi_index  index.php;
    include        fastcgi_params;
    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    fastcgi_pass   192.168.0.200:9000;
}

Extra: How can I share the PHP files to the LXC containers? Is NFS necessary?

1 Answer 1

0

If your PHP5-FPM is installed at 192.168.0.10 and listening to port 9000, and PHP7-FPM is installed at 192.1680.200:9000, your configuration is just fine.

Then you need to share the files from the host to guest. NFS is one option for this.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .