You can significantly improve your website'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'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.

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.

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.

The three pillars of a high-performance web server

Our solution combines three powerful pieces of technology. Each one targets a different aspect of website performance.

1. Nginx: The high-speed engine

Nginx is a high-performance web server. Its primary job is to handle requests from visitors' browsers and deliver your website'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.

2. Brotli: Superior data compression

Before your server sends your website'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.

3. ngx_pagespeed: The automatic optimization robot

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'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:

  • Combine multiple CSS and JavaScript files into single files to reduce HTTP requests.
  • Automatically resize and compress images to the perfect dimensions for the visitor's screen.
  • "Minify" your code by removing unnecessary characters like whitespace and comments.
  • Prioritize the loading of critical CSS.

These optimizations can dramatically improve your site's performance scores (like Google's Core Web Vitals) without you having to manually change a single line of your website's code.

The problem: ngx_pagespeed is abandoned

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.

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.

The ENGINYRING solution: A modern, pre-compiled package

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.

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 VPS hosting environment.

Step-by-step installation guide

Step 1: Connect to your server and prepare your system

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's package list and install any available upgrades before you begin.

sudo apt update && sudo apt upgrade -y

Step 2: Download the ENGINYRING Nginx package

Next, we will download our custom .deb package from the official ENGINYRING GitHub repository. The `wget` command downloads the file directly to your server.

wget https://github.com/ENGINYRING/nginx-with-pagespeed/releases/download/v1/nginx-with-pagespeed_1.29.1-1_amd64.deb

Step 3: Install the package

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.

sudo dpkg -i nginx-with-pagespeed_1.29.1-1_amd64.deb

After the installation is complete, you can verify the version and the compiled-in modules with the following command.

nginx -V

In the output, you should see `--add-module=../ngx_brotli` and `--add-module=../ngx_pagespeed-1.13.35.2-stable`, confirming that the modules were installed correctly.

Configuration and activation

With the software installed, the final step is to configure Nginx to use these new modules for your website.

Step 4: Enabling and configuring Brotli

Brotli needs to be enabled in your main Nginx configuration file. Open the file with a text editor.

sudo nano /etc/nginx/nginx.conf

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.

http {
    # ... other settings ...

    ##
    # Brotli Settings
    ##
    brotli on;
    brotli_comp_level 6;
    brotli_static on;
    brotli_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

    # ... rest of http block ...
}

Step 5: Enabling and configuring ngx_pagespeed

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.

sudo mkdir -p /var/ngx_pagespeed_cache
sudo chown www-data:www-data /var/ngx_pagespeed_cache

Now, create a new configuration file for your PageSpeed settings. This keeps your main Nginx file clean.

sudo nano /etc/nginx/pagespeed.conf

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.

# Main pagespeed settings
pagespeed on;
pagespeed FileCachePath /var/ngx_pagespeed_cache;

# Core filter set
pagespeed CoreFilters on;

# Additional safe filters
pagespeed EnableFilters rewrite_style_attributes;
pagespeed EnableFilters extend_cache;
pagespeed EnableFilters combine_javascript;
pagespeed EnableFilters combine_css;

# Ensure pagespeed works behind a proxy (like Cloudflare)
pagespeed RespectVary on;

Finally, you need to include this new configuration file in the `server` block of your website's configuration file. Open your site's config file (e.g., `/etc/nginx/sites-available/yourdomain.com`) and add the following line inside the `server` section.

server {
    # ... your other server settings like listen, server_name, root ...
    
    include /etc/nginx/pagespeed.conf;
    
    # ... rest of your server block ...
}

Step 6: Test and reload Nginx

After making these changes, it is critical to test your Nginx configuration for syntax errors.

sudo nginx -t

If the test is successful, reload Nginx to apply all your new settings.

sudo systemctl reload nginx

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's response headers in your browser's developer tools. You should see a header for `X-Page-Speed` and, for text-based files, a header for `content-encoding: br`.

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.

Source & Attribution

This article is based on original data belonging to ENGINYRING.COM blog. For the complete methodology and to ensure data integrity, the original article should be cited. The canonical source is available at: Supercharge Your Site: Nginx 1.29.1, Brotli & PageSpeed on Debian 13.