ModSecurity is a an open source Web Application Firewall (WAF). It can detect as well as prevent attacks to web applications. Initially released as an Apache web server module, ModSecurity now supports all major Web Servers including IIS, Nginx and Apache.
If your website is based on PHP and is being served by Apache web server with Nginx as reverse proxy, then you may have experienced 504 Gateway Timeout errors. The error usually happens because some PHP script takes longer than usual to run.
Output buffering in PHP allows output from a PHP script to be stored in a buffer. When the buffer is flushed, the output is displayed to the user. Sometimes we may want to disable output buffering, so we can quickly access the output from a PHP script. For example it is useful to be able to view the output from long running scripts.
Some times we need to non-interactively run scripts which commit to git source code repositories that are hosted remotely. For example we may want push changes to a git repository stored on Bit Bucket. Normally we will be asked to enter our Bit Bucket credentials, but this can be automated.
To allow Apache web server, to process files ending with .html as PHP files, we need to do two things. First we need to set the content-type http header for .html files to text/html. Secondly, we need to tell the Apache web server to process HTML files as PHP files.