Skip to content

Instantly share code, notes, and snippets.

@HeikoMamerow
Last active February 9, 2022 13:23
Show Gist options
  • Save HeikoMamerow/45d82ec557b86f9d3d6e6f547770429f to your computer and use it in GitHub Desktop.
Save HeikoMamerow/45d82ec557b86f9d3d6e6f547770429f to your computer and use it in GitHub Desktop.
Build nginx with Google PageSpeed, Brotli and other modules
How to build your custom Nginx
==============================
Works fine for me with Ubuntu 16.04.
Automated Install with pagespeed module (Google)
------------------------------------------------
If you interested, read the original
Source: https://developers.google.com/speed/pagespeed/module/build_ngx_pagespeed_from_source
-------------8<----------------------
# Before we start, lets clean old stuff
cd
rm -rf nginx-* ngx_brotli* master.* ngx_* nginx_a* release-* v1.1*
# Brotli
cd
git clone https://github.com/google/ngx_brotli.git
cd ngx_brotli
git submodule update --init --recursive
# Accept Language module
cd
wget https://github.com/giom/nginx_accept_language_module/archive/master.zip
unzip master.zip
# Pagespeed module + Nginx + modules
cd
bash <(curl -f -L -sS https://ngxpagespeed.com/install) \
--nginx-version latest \
--ngx-pagespeed-version latest-beta \
--additional-nginx-configure-arguments '--add-module=$HOME/ngx_brotli --add-module=$HOME/nginx_accept_language_module-master --prefix=/usr/local/share/nginx --conf-path=/etc/nginx/nginx.conf --with-http_ssl_module --with-http_v2_module --with-http_gzip_static_module --with-http_perl_module --with-http_stub_status_module --sbin-path=/usr/local/sbin --error-log-path=/var/log/nginx/error.log'
@deweydb
Copy link

deweydb commented Feb 3, 2017

Where does ${PS_NGX_EXTRA_FLAGS} actually get set? or is it just empty?

@edatastyle
Copy link

Hi
i am getting this error

`checking for psol-compiler-compat ... found

  • ngx_pagespeed was configured
    adding module in /root/ngx_brotli
  • ngx_brotli was configured
    adding module in /root/nginx_accept_language_module-master
    ./configure: error: no /root/nginx_accept_language_module-master/config was found
    Error: Failure running './configure --add-module=/root/incubator-pagespeed-ngx-latest-beta --add-module=/root/ngx_brotli --add-module=/root/nginx_accept_language_module-master --prefix=/usr/local/share/nginx --conf-path=/etc/nginx/nginx.conf --with-http_ssl_module --with-http_v2_module --with-http_gzip_static_module --with-http_perl_module --with-http_stub_status_module --sbin-path=/usr/local/sbin --error-log-path=/var/log/nginx/error.log', exiting.`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment