I want to setup symfony with nginx and this config is working fine
server {
listen 80;
root /src/web;
location / {
# try to serve file directly, fallback to app.php
try_files $uri /app.php$is_args$args;
}
location ~ ^/app\.php(/|$) {
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# Prevents URIs that include the front controller. This will 404:
# http://domain.tld/app.php/some-path
# Remove the internal directive to allow URIs like this
internal;
}
error_log /var/log/nginx/symfony_error.log;
access_log /var/log/nginx/symfony_access.log;
}
However i also want that on my server i should also be able to access files via app_dev.php and app_test.php as well
so far with above config. http://127.0.0.1/api/check is working fine
but i also want
http://127.0.0.1/app_dev.php/api/check and http://127.0.0.1/app_test.php/api/check to work as well.
Currently its gives me 404 error
http://127.0.0.1/app.php/api/check?try_files $uri /app.php$is_args$args;. i tried chaging it to app_dev and app_test and it works fine as well but they dont work all together , with apache2 it works , bow now i want to use nginx onlyfastcgi_param PATH_INFO $fastcgi_path_info;. See nginx.com/resources/wiki/start/topics/examples/phpfcgi/…. You also haven't enabled php-fpm for anything other thatapp.phpfastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;and usefastcgi_param PATH_INFO $fastcgi_path_info;, also i tried chaging the regex to use app_dev as well but still i get 404 error