I am struggling with truncated page responses when...
# azure
m
I am struggling with truncated page responses when using nginx in a container app using fastcgi to connect to a fpm-php server. The two containers are in separate container apps on the same subnet. I posted a stackoverflow question here. https://stackoverflow.com/questions/79395666/nginx-php-fpm-azure-container-app-returns-truncated-pages but no answers yet. If I run the nginx container locally everything works, the problem does not happen until I move nginx into Azure. The significant environment difference that I can think of is the load balancer that Azure creates, but I don't know much about how to troubleshoot that. I have tried many iterations of buffer/timeout adjustments to fix this. I dont have any console errors on the frontend. I get about the first 1200 lines but the next 1000 or so are truncated. This issue starts after I have logged into the site and after I have run an "installer" The software is mautic version 5.2.2 I have tried multiple versions of that as well. It seems like the response is chunked and then I don't get the entire response before the connection is closed and response returned. But I would expect to get a front end error with that. I'm willing to share anything to get answers. I just don't know what is useful to share here.
What I found after a lot of digging around is that my nginx configuration was not taking into account the load balancer as a pool. In my http block I needed to use upstream to identify the backend server addresses that are used for load balancing:
Copy code
upstream mauticWeb {
    least_conn;
    server ${MAUTIC_WEB_URL}:9000;
    }
and in my
http
-->
server
block wherever I needed to reach the backend php-fpm server I needed to use the upstream config.
Copy code
server{
    ...
    location ~ ^(.+\.php)(.*)$ {
       ...
       fastcgi_keep_conn on;
       fastcgi_pass mauticWeb;
       ...
    }
    ...
}