I am in the process of setting php-fpm for a Slim Api that my company is going to use in production. Currently I am having trouble with translating a rest endpoint into something that can be executed by php-fpm from a proxied request in Nginx.
So I have a location block in Nginx that looks like this:
# endpoint that needs to be proxied
location /api2/ {
# I know, setting root in a location block is real bad
# But I am dealing with a legacy nginx config that has so much noise in it that I kinda have to do this for now.
root /path/to/api/root/index/folder;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:8000;
}
So I have a php process pool listening on port 8000 and it is able to run php. My trouble is that I keep getting a 404 from Slim on a valid api call. The call being https://example.com/api2/get/data.
I have been able to confirm that, in Slim, the request URI that it is receiving is the /api2/get/data and that is how the endpoint is defined.
Am I missing something in setting up this system with Slim? Is their a special configuration that is needed to make Slim work behind Php-Fpm?
Thank you all in advance!

所有评论(0)