I've been having a problem since i installed mod_pagespeed across our LAMP servers and i can't seem to find an answer to it
Set-up:
- Load balancer across 4 LAMP servers
- Mixture of http and https pages
- Product images are shared amongst the servers through a mounted disk (/mnt/media_images/)
- Apache Alias set up:
Alias /images/media /mnt/media_images
(i.e. www.example.com/images/media/test.jpg located on the server at /mnt/media_images/test.jpg) - mod_pagespeed installed on all servers with exact same config:
ModPagespeed on
ModPagespeedRespectXForwardedProto on
ModPagespeedMapOriginDomain "http://localhost" "http://www.example.com"
ModPagespeedMapOriginDomain "http://localhost" "https://www.example.com"
ModPagespeedMaxInlinedPreviewImagesIndex 20
ModPagespeedEnableFilters remove_comments,collapse_whitespace,combine_javascript,insert_dns_prefetch,defer_javascript,insert_image_dimensions,lazyload_images
The Problem:
mod_pagespeed optimises all images on http fine, rewriting filenames and fetching them no problem, i.e.:
- http://www.example.com/images/layout/example1.jpg to http://www.example.com/images/layout/example1.jpg.pagespeed.ce.Sh5dWv3czL.jpg
- http://www.example.com/images/media/example2.jpg to http://www.example.com/images/media/example2.jpg.pagespeed.ce.Sh5dWv3czL.jpg
On https all non-product images work fine just like on http, i.e.:
- https://www.example.com/images/layout/example1.jpg to https://www.example.com/images/layout/example1.jpg.pagespeed.ce.Sh5dWv3czL.jpg
...but the product images don't work. The filenames are re-written, but visiting these rewritten filenames return 404s. If you take the rewritten filename and simply change https:// to http:// the image is then returned.
I've tested it on a non load-balanced set up and that seemed to work, so the problem seems to be the combination of a load-balancer with https and an alias pointing to the mounted disk.
Any help or suggestions would be greatly appreciated