NGINX Pagespeed
important
The repository of this docs is on GitHub https://github.com/mohsenmottaghi/nginx-pagespeed
caution
This docs is not ready
Nginx-Pagespeed
This Docker image include Nginx , Pagespeed module and ...
Note: Dockerfile Cloned by me from elct9620.
Docker Image Tags:
- latest
- ubuntu-16-04
- ubuntu-18-04
- ubuntu-18-10
- ubuntu-19-04
- debian-latest
- debian-stretch
- debian-jessie
Version:
- NGINX_VERSION 1.16.1 ( stable version )
- NPS_VERSION 1.13.35.2-stable
- OPENSSL_VERSION 1.1.0g
Roadmap
- Add SSL support
- Add Proxy Mode support
- Improve template to support more complex config file struct
- Add Laravel support
- Add Let's Encrypt support with auto renew
Compiled Modules
- http_ssl_module
- http_realip_module
- http_gunzip_module
- http_gzip_static_module
- http_secure_link_module
- http_v2_module
- threads
- file-aio
- ipv6
- http-client-body-temp-path=/var/cache/nginx/client_temp
- http-proxy-temp-path=/var/cache/nginx/proxy_temp
- http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp
- http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp
- http-scgi-temp-path=/var/cache/nginx/scgi_temp
- http_addition_module
- http_sub_module
- http_dav_module
- http_flv_module
- http_mp4_module
- http_random_index_module
- http_secure_link_module
- http_stub_status_module
- http_auth_request_module
- http_xslt_module=dynamic
- http_image_filter_module=dynamic
- http_geoip_module=dynamic
- stream
- stream_ssl_module
- stream_ssl_preread_module
- stream_realip_module
- stream_geoip_module=dynamic
- http_slice_module
- mail_ssl_module
- compat
Usage
The new version provide options to customize Nginx config.
Host static files
docker run -v $(pwd)/www:/var/www/html elct9620/nginx-pagespeed
Run with customize config
docker run --env='SERVER_NAME=example.com' elct9620/nginx-pagespeed
Options
To generate customize config file, just add environment variable when run. Below is current supported options.
Default
SERVER_NAMEThe server name, default islocalhostDOCUMENT_ROOTThe root path, default is/var/www/html. You can change it point to other path.INDEX_FILESThe nginx default hasindex.html index.htmas index file, you can add other setting likeindex.phpALLOW_ORIGINCROS setting, default is limited to same as server name.
FastCGI
FASTCGI_HOSTWhen this variable is not empty, will enable FastCGI mode for PHP.FASTCGI_PORTThe port for FastCGI server, default is9000FASTCGI_INDEXThe default index file for FastCGI, default isindex.phpFASTCGI_ROOTDue to the FastCGI server is not run with Nginx, you can change the path for it. Default same as document root.
PageSpeed
PAGESPEED_ENABLEYou can disable pagespeed by change this variable, default isonPAGESPEED_REWRITE_LEVELThe default pagespeed optimize options group, default isPassThroughPAGESPEED_HEADERThe response header, default isPowered by ngx_pagespeed
Cache
CACHE_LEVELThe cache level for FastCGI (proxy will support soon), default is1:2CACHE_ZONE_SIZEThe in memory cache size, default is100mCache_INACTIVE_TIMEThe cache inactive time, default is60m
Extension
This image also provide some extra config to fast setup some popular Framework/CMS.
WORDPRESS_ADDONWhen set toyeswill change config to add extra config to letWordPresswork correctly.
GitHub Action Status