• Resolved Andrew

    (@andrewspear)


    I have been getting 503 server errors pretty much daily and have been working with our host to resolve it. It turns out that they have multiple clients experiencing the same issue and it can be solved by tweaking your configuration file. I have applied the fix on my site but it’ll be overwritten next time you update the plugin, can you please consider adding this fix into your code base so it’s fixed for everyone?

    Here’s an more detailed explanation of the issue and the fix:

    ———-

    I did some research on other customers who experienced similar issues on our platform, and it seems this can be due to the following line included in plugin or theme files

    ob_start(“ob_gzhandler”);
    The 503s can happen as our Nginx configuration requires our gzip handler buffering to be flushed after starting. I searched your sites files and found this was present in the following file /plugins/autoptimize/config/default.php. The code itself is the following

    30:if(ini_get(‘output_handler’) == ‘ob_gzhandler’ || ini_get(‘zlib.output_compression’) == 1)
    This can be commented out, or alternatively we can add the following to the bottom of the file ob_flush(); do ensure its flushed after starting. I didnt want to remove anything from the file so i just went ahead and added that for you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    Interesting. So you’re running with “serve as static files” off Andrew?

    Thread Starter Andrew

    (@andrewspear)

    @optimizingmatters No, I actually have “save aggregated script/css as static files” turned on:

    I also have these settings turned on, in case it helps:

    • Optimize JavaScript Code
    • Aggregate JS-files
    • Optimize CSS Code
    • Aggregate CSS-files
    • Optimize HTML Code
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    in that case the code in /plugins/autoptimize/config/default.php is never used/ executed @andrewspear. quite the mystery ..

    Thread Starter Andrew

    (@andrewspear)

    Thanks for your reply @optimizingmatters, perhaps it’s a red herring then ??

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Well, I’m pretty sure that line of code is not the root cause of the 503’s ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Nginx Gzip Compatibility’ is closed to new replies.