Skip to content

[HttpKernel] Logger makes nginx choke #38462

Closed
@MatTheCat

Description

@MatTheCat

Symfony version(s) affected: probably every including #36855

Description

Now that HttpKernel’s logger uses error_log by default, it will make nginx choke with

upstream sent too big header while reading response header from upstream

if it sends some, using the default php-fpm and nginx docker images.

How to reproduce

  1. Start from symfony/skeleton
composer create-project symfony/skeleton symfony
cd symfony
  1. Add docker-compose.yml
version: "3"

services:
  nginx:
    image: nginx:1.19.3-alpine
    ports:
      - 80:80
    volumes:
      - ./www.conf:/etc/nginx/conf.d/www.conf:ro
      - ./public:/usr/share/nginx/html:ro

  php:
    image: php:7.4.11-fpm-alpine3.12
    volumes:
      - ./:/var/www/html
  1. Add www.conf
server {
    server_name domain.test;
    root /usr/share/nginx/html;

    location / {
        try_files $uri /index.php$is_args$args;
    }

    location = /index.php {
        fastcgi_pass php:9000;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME /var/www/html/public/index.php;

        internal;
    }
}
  1. Require some packages
composer require symfony/security-bundle symfony/stopwatch symfony/web-profiler-bundle
  1. Start services
docker-compose up -d
  1. Make domain.test resolve to 127.0.0.1
  2. Access http://domain.test/

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions