<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Control WebPanel Wiki &#187; Brotli for Nginx</title>
	<atom:link href="https://wiki.centos-webpanel.com/tag/brotli-for-nginx/feed" rel="self" type="application/rss+xml" />
	<link>https://wiki.centos-webpanel.com</link>
	<description>CentOS WebPanel Wiki</description>
	<lastBuildDate>Wed, 12 Feb 2025 20:38:16 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.1.1</generator>
	<item>
		<title>Enabling Brotli Compression on Nginx</title>
		<link>https://wiki.centos-webpanel.com/enabling-brotli-compression-on-nginx</link>
		<comments>https://wiki.centos-webpanel.com/enabling-brotli-compression-on-nginx#comments</comments>
		<pubDate>Wed, 15 May 2019 23:21:52 +0000</pubDate>
		<dc:creator><![CDATA[publisher]]></dc:creator>
				<category><![CDATA[Nginx]]></category>
		<category><![CDATA[Brotli for Nginx]]></category>

		<guid isPermaLink="false">http://wiki.centos-webpanel.com/?p=1152</guid>
		<description><![CDATA[Brotli is a generic-purpose lossless compression algorithm that compresses data using a combination of a modern variant of the LZ77 algorithm, Huffman coding and 2nd order context modeling, with a compression ratio comparable to the best currently available general-purpose compression methods. It is similar in speed with deflate but offers more dense compression. Step 1 [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Brotli is a generic-purpose lossless compression algorithm that compresses data using a combination of a modern variant of the LZ77 algorithm, Huffman coding and 2nd order context modeling, with a compression ratio comparable to the best currently available general-purpose compression methods. It is similar in speed with deflate but offers more dense compression.</p>
<h2>Step 1 :</h2>
<p>Check <strong>Nginx</strong> web server/Proxy is already installed on your server</p>
<h2>Step 2 :</h2>
<p><strong>Download and install Nginx Static Brotli module :</strong></p>
<pre>cd /etc/nginx/modules
wget http://dl1.centos-webpanel.com/files/nginx/modules/nginx-brotli-modules.zip
unzip nginx-brotli-modules.zip
rm -rf nginx-brotli-modules.zip 
</pre>
<h2>Step 3 :</h2>
<p><strong>Now add nginx module configuration on "nginx.conf" :</strong></p>
<pre>nano /etc/nginx/nginx.conf
</pre>
<p><strong>Now add this lines on top of the nginx.conf :</strong></p>
<pre>load_module "modules/ngx_http_brotli_filter_module.so";
load_module "modules/ngx_http_brotli_static_module.so";
</pre>
<p><strong>Now add brotli compression configuration in nginx.conf file in <code>http {</code>section and before http closing <code>}</code>:</strong></p>
<pre>   #brotli
    brotli              on;
    brotli_comp_level   6;
    brotli_static       on;
    brotli_types        text/xml image/svg+xml application/x-font-ttf image/vnd.microsoft.icon application/x-font-opentype application/json font/eot application/vnd.ms-fontobject application/javascript font/otf application/xml application/xhtml+xml text/javascript  application/x-javascript text/plain application/x-font-truetype application/xml+rss image/x-icon font/opentype text/css image/x-win-bitmap;
</pre>
<p><strong>Save the file and restart nginx :</strong></p>
<pre>service nginx restart
or
systemctl restart nginx
</pre>
<p>Go to one of the site to check :<br />
<a href="https://www.giftofspeed.com/gzip-test/" target="_blank" rel="noopener">https://www.giftofspeed.com/gzip-test/</a><br />
<a href="https://www.websiteplanet.com/webtools/gzip-compression/" target="_blank">https://www.websiteplanet.com/webtools/gzip-compression/</a></p>
<p>For advanced user you can check content-encoding via http header :</p>
<pre>HTTP/2.0 200 OK
server: nginx
content-type: text/html; charset=UTF-8
vary: Accept-Encoding, Cookie
<strong><span style="color: #993300;">content-encoding: br</span>  </strong> 
</pre>
]]></content:encoded>
			<wfw:commentRss>https://wiki.centos-webpanel.com/enabling-brotli-compression-on-nginx/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
