Skip to content

Instantly share code, notes, and snippets.

@xwiz
Last active September 12, 2021 15:51
Show Gist options
  • Save xwiz/a290e1ca304dc1c9b03932c03f4a9db8 to your computer and use it in GitHub Desktop.
Save xwiz/a290e1ca304dc1c9b03932c03f4a9db8 to your computer and use it in GitHub Desktop.

Revisions

  1. xwiz revised this gist Sep 12, 2021. 1 changed file with 4 additions and 3 deletions.
    7 changes: 4 additions & 3 deletions nginx_pagespeed.sh
    Original file line number Diff line number Diff line change
    @@ -16,9 +16,6 @@ unzip master.zip

    sudo mkdir /var/nginx_cache

    #change the user to the nginx user if different
    sudo chown nginx:nginx /var/nginx_cache

    bash <(curl -f -L -sS https://ngxpagespeed.com/install) \
    --nginx-version latest \
    --ngx-pagespeed-version latest-beta \
    @@ -27,3 +24,7 @@ bash <(curl -f -L -sS https://ngxpagespeed.com/install) \
    --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module
    --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module
    --with-stream_ssl_module --with-stream_ssl_preread_module'


    #change the user to the nginx user if different
    sudo chown nginx:nginx /var/nginx_cache
  2. xwiz revised this gist Sep 12, 2021. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions nginx_pagespeed.sh
    Original file line number Diff line number Diff line change
    @@ -14,6 +14,11 @@ wget https://github.com/giom/nginx_accept_language_module/archive/master.zip

    unzip master.zip

    sudo mkdir /var/nginx_cache

    #change the user to the nginx user if different
    sudo chown nginx:nginx /var/nginx_cache

    bash <(curl -f -L -sS https://ngxpagespeed.com/install) \
    --nginx-version latest \
    --ngx-pagespeed-version latest-beta \
  3. xwiz revised this gist Sep 12, 2021. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions nginx_pagespeed.sh
    Original file line number Diff line number Diff line change
    @@ -17,6 +17,8 @@ unzip master.zip
    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=/etc/nginx --conf-path=/etc/nginx/nginx.conf --sbin-path=/usr/sbin --error-log-path=/var/log/nginx/error.log'
    --additional-nginx-configure-arguments '--add-module=$HOME/ngx_brotli --add-module=$HOME/nginx_accept_language_module-master --prefix=/etc/nginx --conf-path=/etc/nginx/nginx.conf --sbin-path=/usr/sbin --error-log-path=/var/log/nginx/error.log
    --http-client-body-temp-path=/var/nginx_cache/client_temp --http-proxy-temp-path=/var/nginx_cache/proxy_temp --http-fastcgi-temp-path=/var/nginx_cache/fastcgi_temp --http-uwsgi-temp-path=/var/nginx_cache/uwsgi_temp --http-scgi-temp-path=/var/nginx_cache/scgi_temp
    --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module
    --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module
    --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module
    --with-stream_ssl_module --with-stream_ssl_preread_module'
  4. xwiz revised this gist Sep 12, 2021. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions nginx_pagespeed.sh
    Original file line number Diff line number Diff line change
    @@ -17,5 +17,6 @@ unzip master.zip
    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_stub_status_module --sbin-path=/usr/local/sbin --error-log-path=/var/log/nginx/error.log'

    --additional-nginx-configure-arguments '--add-module=$HOME/ngx_brotli --add-module=$HOME/nginx_accept_language_module-master --prefix=/etc/nginx --conf-path=/etc/nginx/nginx.conf --sbin-path=/usr/sbin --error-log-path=/var/log/nginx/error.log'
    --http-client-body-temp-path=/var/nginx_cache/client_temp --http-proxy-temp-path=/var/nginx_cache/proxy_temp --http-fastcgi-temp-path=/var/nginx_cache/fastcgi_temp --http-uwsgi-temp-path=/var/nginx_cache/uwsgi_temp --http-scgi-temp-path=/var/nginx_cache/scgi_temp
    --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module
  5. xwiz revised this gist Sep 12, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion nginx_pagespeed.sh
    Original file line number Diff line number Diff line change
    @@ -17,5 +17,5 @@ unzip master.zip
    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'
    --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_stub_status_module --sbin-path=/usr/local/sbin --error-log-path=/var/log/nginx/error.log'

  6. xwiz created this gist Sep 12, 2021.
    21 changes: 21 additions & 0 deletions nginx_pagespeed.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    #if nginx already installed consider stopping service first, you can still reserve running this command until the actual build stage
    #sudo service nginx stop

    #assume you already have git libssl installed, otherwise uncomment
    #sudo apt install libssl-dev
    #sudo apt install git
    cd ~
    git clone https://github.com/google/ngx_brotli.git
    cd ngx_brotli
    git submodule update --init --recursive

    cd ~
    wget https://github.com/giom/nginx_accept_language_module/archive/master.zip

    unzip master.zip

    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'