Nginx Gzip Compatibility
-
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 following30: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.
- The topic ‘Nginx Gzip Compatibility’ is closed to new replies.