{"id":1751,"date":"2025-09-15T20:07:13","date_gmt":"2025-09-15T20:07:13","guid":{"rendered":"https:\/\/blog.eu.enginyr.ing\/?p=1751"},"modified":"2025-09-15T20:10:25","modified_gmt":"2025-09-15T20:10:25","slug":"supercharge-your-site-nginx-1-29-1-brotli-pagespeed-on-debian-13","status":"publish","type":"post","link":"https:\/\/www.serverspan.com\/en\/blog\/supercharge-your-site-nginx-1-29-1-brotli-pagespeed-on-debian-13\/","title":{"rendered":"Supercharge Your Site: Nginx 1.29.1, Brotli &#038; PageSpeed on Debian 13"},"content":{"rendered":"\n\n<p class=\"wp-block-paragraph\">You can significantly improve your website&#8217;s loading times by using a modern version of the Nginx web server with two powerful modules: Brotli for superior compression and ngx_pagespeed for automatic, on-the-fly optimizations. The main challenge is that Google&#8217;s ngx_pagespeed module is no longer officially maintained and is incompatible with the latest Nginx versions. ENGINYRING has solved this problem. We have patched the ngx_pagespeed source code to make it compatible and have compiled the latest Nginx 1.29.1 with both Brotli and our fixed ngx_pagespeed module into a single, easy-to-install .deb package for Debian 13.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Website speed is not a luxury. It is a critical factor for user experience, search engine rankings, and conversion rates. A slow website frustrates visitors and hurts your business. While there are many ways to optimize a site, some of the most powerful improvements happen at the server level. The software that delivers your website to your visitors, your web server, plays a massive role in how fast your pages load.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This guide provides a step-by-step tutorial on how to bypass years of development stagnation and install a state-of-the-art web server stack on your Debian 13 server. You will learn what these technologies do, why they are so effective, and how to use our free, pre-compiled package to get all the benefits without the complex and often frustrating process of compiling from source.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The three pillars of a high-performance web server<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Our solution combines three powerful pieces of technology. Each one targets a different aspect of website performance.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. Nginx: The high-speed engine<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Nginx is a high-performance web server. Its primary job is to handle requests from visitors&#8217; browsers and deliver your website&#8217;s files to them. It is known for its incredible speed and efficiency, especially when handling a large number of simultaneous visitors. Using the latest version of Nginx ensures you have the most recent performance improvements and security patches. It is the foundation of our high-speed stack.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Brotli: Superior data compression<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Before your server sends your website&#8217;s files to a visitor, it can compress them to make them smaller. Smaller files mean faster transfer times and quicker page loads. For years, the standard for this has been Gzip. Brotli is a newer, more powerful compression algorithm developed by Google. Brotli consistently provides a higher compression ratio than Gzip. This means it makes your files even smaller, resulting in a noticeable speed boost, especially for users on slower connections.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. ngx_pagespeed: The automatic optimization robot<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">ngx_pagespeed is an extraordinary module, also originally developed by Google, that acts like an automatic optimization expert living inside your web server. It rewrites your website&#8217;s code on the fly, before it is sent to the visitor, to apply a huge number of web performance best practices. It can do things like:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Combine multiple CSS and JavaScript files into single files to reduce HTTP requests.<\/li>\n\n\n\n<li>Automatically resize and compress images to the perfect dimensions for the visitor&#8217;s screen.<\/li>\n\n\n\n<li>&#8220;Minify&#8221; your code by removing unnecessary characters like whitespace and comments.<\/li>\n\n\n\n<li>Prioritize the loading of critical CSS.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">These optimizations can dramatically improve your site&#8217;s performance scores (like Google&#8217;s Core Web Vitals) without you having to manually change a single line of your website&#8217;s code.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The problem: ngx_pagespeed is abandoned<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">There is a major problem with this perfect trio. Google stopped actively developing the ngx_pagespeed module years ago. As Nginx has continued to evolve, the old pagespeed code has become incompatible. If you try to compile the latest version of Nginx (1.29.1) with the official, unmaintained version of ngx_pagespeed, the compilation will fail. It simply does not work.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This has left a huge gap in the market. Website owners have to choose between running an old, insecure version of Nginx just to keep using pagespeed, or upgrading to a modern Nginx and losing all the benefits of automatic optimization. Compiling a web server from source is already a complex task. Trying to debug and patch an abandoned module to work with a new code base is a challenge even for experienced system administrators.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The ENGINYRING solution: A modern, pre-compiled package<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">We believe that you should not have to choose between modern security and powerful performance. Our engineers have invested the time and expertise to solve this compatibility problem. We have taken the original ngx_pagespeed source code, applied the necessary patches to make it fully compatible with the latest Nginx 1.29.1, and compiled it with Brotli support built-in.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We have packaged this state-of-the-art web server stack into a simple, easy-to-install .deb file, available for free on our GitHub repository. This gives you all the benefits of the latest technology without any of the complex compilation and debugging work. It is the easiest way to get a truly optimized web server running on your Debian 13 <a href=\"https:\/\/www.enginyring.com\/en\/virtual-servers\">VPS hosting<\/a> environment.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step-by-step installation guide<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Connect to your server and prepare your system<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">First, connect to your Debian 13 server via SSH. This guide assumes you are operating as a user with sudo privileges. It is always a good practice to update your system&#8217;s package list and install any available upgrades before you begin.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update && sudo apt upgrade -y<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Download the ENGINYRING Nginx package<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Next, we will download our custom .deb package from the official ENGINYRING GitHub repository. The `wget` command downloads the file directly to your server.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wget https:\/\/github.com\/ENGINYRING\/nginx-with-pagespeed\/releases\/download\/v1\/nginx-with-pagespeed_1.29.1-1_amd64.deb<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Install the package<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Now, use the `dpkg` command to install the package. This will install Nginx 1.29.1 along with all the necessary dependencies and our compiled modules.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dpkg -i nginx-with-pagespeed_1.29.1-1_amd64.deb<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After the installation is complete, you can verify the version and the compiled-in modules with the following command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nginx -V<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">In the output, you should see `&#8211;add-module=..\/ngx_brotli` and `&#8211;add-module=..\/ngx_pagespeed-1.13.35.2-stable`, confirming that the modules were installed correctly.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Configuration and activation<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">With the software installed, the final step is to configure Nginx to use these new modules for your website.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: Enabling and configuring Brotli<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Brotli needs to be enabled in your main Nginx configuration file. Open the file with a text editor.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/nginx\/nginx.conf<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Inside the `http` block, add the following lines. This tells Nginx to turn Brotli compression on, sets the compression level, and specifies which file types should be compressed.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>http {\n    # ... other settings ...\n\n    ##\n    # Brotli Settings\n    ##\n    brotli on;\n    brotli_comp_level 6;\n    brotli_static on;\n    brotli_types text\/plain text\/css application\/json application\/javascript text\/xml application\/xml application\/xml+rss text\/javascript;\n\n    # ... rest of http block ...\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 5: Enabling and configuring ngx_pagespeed<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Next, we need to create a configuration file for PageSpeed and tell it where to store its cache. First, create a directory for the cache and give the Nginx user ownership of it.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mkdir -p \/var\/ngx_pagespeed_cache\nsudo chown www-data:www-data \/var\/ngx_pagespeed_cache<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, create a new configuration file for your PageSpeed settings. This keeps your main Nginx file clean.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/nginx\/pagespeed.conf<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Paste the following baseline configuration into this file. This turns PageSpeed on and enables a set of core filters that provide safe and effective optimizations without breaking most websites.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Main pagespeed settings\npagespeed on;\npagespeed FileCachePath \/var\/ngx_pagespeed_cache;\n\n# Core filter set\npagespeed CoreFilters on;\n\n# Additional safe filters\npagespeed EnableFilters rewrite_style_attributes;\npagespeed EnableFilters extend_cache;\npagespeed EnableFilters combine_javascript;\npagespeed EnableFilters combine_css;\n\n# Ensure pagespeed works behind a proxy (like Cloudflare)\npagespeed RespectVary on;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, you need to include this new configuration file in the `server` block of your website&#8217;s configuration file. Open your site&#8217;s config file (e.g., `\/etc\/nginx\/sites-available\/yourdomain.com`) and add the following line inside the `server` section.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>server {\n    # ... your other server settings like listen, server_name, root ...\n    \n    include \/etc\/nginx\/pagespeed.conf;\n    \n    # ... rest of your server block ...\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 6: Test and reload Nginx<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">After making these changes, it is critical to test your Nginx configuration for syntax errors.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nginx -t<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If the test is successful, reload Nginx to apply all your new settings.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl reload nginx<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Your website is now being served with Brotli compression and is being automatically optimized by ngx_pagespeed. You can verify this by inspecting your website&#8217;s response headers in your browser&#8217;s developer tools. You should see a header for `X-Page-Speed` and, for text-based files, a header for `content-encoding: br`.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You have successfully installed and configured a modern, high-performance web server stack. This combination of the latest Nginx, superior Brotli compression, and our patched ngx_pagespeed module provides a powerful automated system for keeping your website fast. By providing this package for free, we aim to empower all users with the best possible tools for their online projects.<\/p>\n ","protected":false},"excerpt":{"rendered":"<p>You can significantly improve your website&#8217;s loading times by using a modern version of the Nginx web server with two powerful modules: Brotli for superior compression and ngx_pagespeed for automatic, on-the-fly optimizations. The main challenge is that Google&#8217;s ngx_pagespeed module is no longer officially maintained and is incompatible with the latest Nginx versions. ENGINYRING has [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1752,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[10706,10703,6448,10698,5991,10707,10705,10701,10700,10696,10697,10702,10695,10708,10699,10704,425,7134,428],"class_list":["post-1751","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-brotli-vs-gzip","tag-compile-nginx","tag-core-web-vitals","tag-debian-13-nginx","tag-debian-vps","tag-enginyring-tools","tag-improve-page-load-time","tag-install-ngx_pagespeed","tag-nginx-1-29-1","tag-nginx-brotli","tag-nginx-pagespeed","tag-nginx-tutorial","tag-ngx_pagespeed","tag-open-source-2","tag-optimize-website-speed","tag-pagespeed-filters","tag-vps-hosting","tag-web-server-optimization","tag-website-performance"],"_links":{"self":[{"href":"https:\/\/www.serverspan.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1751","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.serverspan.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.serverspan.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.serverspan.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.serverspan.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1751"}],"version-history":[{"count":3,"href":"https:\/\/www.serverspan.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1751\/revisions"}],"predecessor-version":[{"id":1756,"href":"https:\/\/www.serverspan.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1751\/revisions\/1756"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.serverspan.com\/blog\/index.php?rest_route=\/wp\/v2\/media\/1752"}],"wp:attachment":[{"href":"https:\/\/www.serverspan.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1751"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.serverspan.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1751"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.serverspan.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1751"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}