HTTP 500 (Received an invalid status line) on PDF download - Symfony 5

Pablo Bondia-Luttiau 1 Reputation point
2021-07-19T14:15:39.1+00:00

Hello,

I recently created a Symfony app used to download some protected content. The route is like "/download/folder/XXXX.pdf", it checks for user permissions to view the file with Azure Authentication token.

I have a DEV Azure AppService, and a PROD one. The DEV instance works fine, and the file is downloadable. However, only on the PROD environment, the download doesn't work and the server responds with a 500 error code. The Symfony code is exactly the same between the two.

I've pinpointed the problem : it seems to occur whenever a PDF or DOCX file is sent. RDP files are sent normally. Nothing appears in Symfony logs, but one line in the AppService log seems to be the issue :

Failed to forward request to application. Encountered a System.Net.Http.HttpRequestException exception after 2561.254ms with message: Received an invalid status line: ''.. Check application logs to verify the application is properly handling HTTP traffic.

Does anyone has an idea on how to resolve this issue ?

Thanks,

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,971 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.