A PHP docker image file, quickly launch your webserver (with nginx pagespeed)
10K+
You can deploy this image on single docker container or docker swarm, the OS of this container is Centos 7
docker run -d -p 80:80 dylanlopez/pagespeed
Open your browser, load your server's IP address, you will see the phpinfo() page
http://YOUR_SERVER_IP/test.jpg , you will see a very big-size image, loaded progressivelyhttp://YOUR_SERVER_IP/test.css , you will see a regular css page, reload the page few times, you will see the CSS file had been compressed and minified. that means the pagespeed engine is working/usr/share/nginx/html/public
You can edit the nginx.conf file, located at /etc/nginx/nginx.conf , just remove the option that you want to disable, or add more optimizations
#Minify CSS,javascript
pagespeed EnableFilters rewrite_css;
pagespeed EnableFilters rewrite_javascript;
#combine CSS
pagespeed EnableFilters combine_css;
#Compress image
pagespeed EnableFilters recompress_images;
pagespeed EnableFilters sprite_images;
pagespeed EnableFilters make_google_analytics_async;
#Optimize for mobile
pagespeed EnableFilters resize_mobile_images;
#https://www.pagespeedguide.com/documentation/optimizations
pagespeed EnableFilters insert_dns_prefetch;
pagespeed EnableFilters lazyload_images;
pagespeed EnableFilters convert_jpeg_to_progressive;
pagespeed EnableFilters convert_jpeg_to_webp;
#HTML
pagespeed EnableFilters remove_comments;
To learn more : https://www.pagespeedguide.com/documentation/optimizations
Open the file /etc/nginx/nginx.conf , change pagespeed On; to pagespeed Off;
.php files in my public folder, why does the server always load the index.php file?By default, all request will forward to index.php file, you can remove this behavior by edit the /etc/nginx/nginx.conf file, look for
location / {
#Forward all request to index.php
try_files $uri $uri/ /index.php?$args;
}
and remove the line try_files $uri $uri/ /index.php?$args;
/etc/php.ini
(More information will be provided soon...)
Content type
Image
Digest
Size
435 MB
Last updated
about 4 years ago
docker pull dylanlopez/pagespeed