I need to have multiple PHP-FPMs on single domain.
Example: services.local/notification -> notification:9000 services.local/auth -> auth:9000
So, I have a vhost configuration:
server {
server_name services.local;
root /www;
include /etc/nginx/conf.d/services/*.conf;
error_log /var/log/nginx/symfony_error.log;
}
And I have a notification.conf
location /notification {
root /www/;
index app.php index.html;
#try_files $uri $uri /notification/web/app.php?$is_args$args;
rewrite ^(.*)$ /notification/web/app.php last;
}
location /notification/web/app.php {
fastcgi_pass notification-upstream;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /www/notification/web/app.php;
fastcgi_param HTTPS on;
}
The problem is that every rewrite to the app.php results in downloading it's contents, not passing it to FPM.
When I access the app.php directly then it's passed to PHP-FPM, only problem is with a combination of subdirectory + PHP-FPM + rewrite
I think I tried everything for two days and I don't have any other ideas. This config was rebuilded 50 times :)