Good morning, I want to make the same nginx vhost that can work with different php applications (symfony and Thelia). My problem is with the try_files instruction. In symfony the try_files must target app.php but in Thelia it must target index.php. So I wanted to modify the try_files statement as follows:
server {
listen 80;
server_name *.tld;
root /var/www/web;
location / {
try_files $uri /app.php$is_args$args /index.php$is_args$args;
}
location ~ ^/(app|app_dev|config|index|index_dev)\.php(/|$) {
fastcgi_pass php_alias:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param APP_ENV dev;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
fastcgi_buffer_size 128k;
fastcgi_buffers 256 16k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
}
}
Unfortunately, it doesn't work. Php is no longer interpreted. So how can I register multiple php files in the try_files statement?
location ~ \.php(/|$)?