I'd like to setup server to use pagespeed reverse proxy server with apache for several sites which cannot run pagespeed on their origin. It seems I should be able to create a
VirtualHost for each site and use
ModPagespeedMapProxyDomain to specify the origin server. I haven't been able to get this to work. Here's what I have so far.
http://origin.example.com/is the web server for all dynamic and static content. It does not run pagespeed.
http://www.example.com/will be the pagespeed server configured as a reverse proxy. No files are hosted here.
mod-pagespeed-stable-18.104.22.168-7251.x86_64 for CentOS and am using the default config from
/etc/httpd/conf.d/pagespeed.conf except with
CoreRules enabled—see my config.
I then added a VirtualHost directory:
<VirtualHost 111.222.333.444:80> ServerName www.example.com <IfModule pagespeed_module> ModPagespeed On ModPagespeedMapProxyDomain www.example.com origin.example.com </IfModule> </VirtualHost>
Now any requests to http://www.example.com/ results in an empty page with a
403 Forbidden header:
[q@localhost ~] curl -I http://www.example.com/ HTTP/1.1 403 Forbidden […]
The request is logged to the global
access_log, but there are no messages in
error_log (does MPS have its own error log?). I am able to access
http://www.example.com/pagespeed_global_admin but there is no indication there of errors.
If I remove the
ModPagespeed* config and set up the vhost as a proxy using
ProxyPassReverse / http://origin.example.com/, the site loads fine. However, of course, pagespeed doesn't take effect.
Can you see what I've done wrong? What is the recommended way to setup a pagespeed reverse proxy?