Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-57810

Disable buffers in nginx when NO_OUTPUT_BUFFERING is on

XMLWordPrintable

    • MOODLE_31_STABLE, MOODLE_32_STABLE
    • MOODLE_31_STABLE, MOODLE_32_STABLE
    • MDL-57810-nginx-buffers
    • Hide

      Manually mess with nginx buffer config

      Show
      Manually mess with nginx buffer config
    • Hide

      Install moodle under an nginx instance with buffering on. View any page that a progress bar and it should smoothly progress.

      A minimal test case progress bar can be found here:

      https://github.com/brendanheywood/moodle-tool_heartbeat/blob/master/progress.php

      Install that plugin, then load the page. It should show a status update every second and complete in 5 seconds. Under nginx it just appears at 100% after 5 seconds.

      Show
      Install moodle under an nginx instance with buffering on. View any page that a progress bar and it should smoothly progress. A minimal test case progress bar can be found here: https://github.com/brendanheywood/moodle-tool_heartbeat/blob/master/progress.php Install that plugin, then load the page. It should show a status update every second and complete in 5 seconds. Under nginx it just appears at 100% after 5 seconds.

      For pages which define:

      define('NO_OUTPUT_BUFFERING', true);

      This may not work by default under nginx which adds an additional layer of buffering. Instead of requiring nginx config changes we can just send this header when needed:

      header('X-Accel-Buffering: no');

      See also: https://www.nginx.com/resources/wiki/start/topics/examples/x-accel/#x-accel-buffering

            brendanheywood Brendan Heywood
            brendanheywood Brendan Heywood
            Matt Porritt Matt Porritt
            Dan Poltawski Dan Poltawski
            Dan Poltawski Dan Poltawski
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.