Open davidbarratt opened 1 year ago
Hi, We currently don't have plans to add native support for FastCGI but I added it to our features request backlog.
I've just experienced the same issue when a nginx container is not able to communicate with php container via port 9000 with fastcgi_pass php:9000;
in the configuration.
@vienleidl how are your containers deployed? If they are multiple containers in the same app, I think you’ll need to update the config to fastcgi_pass 127.0.0.1:9000;
as containers will communicate over localhost.
@vienleidl how are your containers deployed? If they are multiple containers in the same app, I think you’ll need to update the config to
fastcgi_pass 127.0.0.1:9000;
as containers will communicate over localhost.
Hi Anthony, they're not as multiple containers in the same Container App. I did migrate the current microservices on Azure Multi-Container App Services (Docker Compose) to ACA, each container is responsible for each service within the same Container App Environment. One of them is running NGINX as a reverse proxy for forwarding the requests to other containers, it works well. However, one of them is running PHP-FPM needs to be communicated with other container via FastCGI protocol. The log is like below fyi:
2023-07-12T04:04:00.167612848Z 2023/07/12 04:04:00 [error] 47#47: *51 upstream timed out (110: Operation timed out) while connecting to upstream, client: 100.100.0.46, server: , request: "GET /?doc=xxx&document=xxx HTTP/1.1", upstream: "fastcgi://100.100.143.220:9000", host: "xxx.internal.yellowisland-xxxxxxxx.westeurope.azurecontainerapps.io", referrer: "https://xxx.internal.yellowisland-xxxxxxxx.westeurope.azurecontainerapps.io/?doc=xxx&document=xxx
@vienleidl Can you share the configuration of the fast cgi app? Please confirm it has ingress enabled for TCP and target/external ports set to 9000.
@vienleidl Can you share the configuration of the fast cgi app? Please confirm it has ingress enabled for TCP and target/external ports set to 9000.
Hi Anthony, I've just tested again, now it works well when enabling an internal ingress with TCP and target/exposed port are set to 9000.
Is your feature request related to a problem? Please describe.
PHP Applications have to use Apache (slow startup?) or deploy two containers (Nginx + PHP-FPM). It's a pain to have to configure this correctly.
Describe the solution you'd like.
I would like it if the Container App Ingress supported the FastCGI protocol as a "target protocol" or "backend protocol". The nginx ingress controller for k8s already supports this.
Describe alternatives you've considered.
Additional context.
The official Docker Image for PHP basically gives you the same choices:
OR
I should also note that other languages support FastCGI, so this is not specific to PHP.