gnif edited a comment on issue #1851:
URL: 
https://github.com/apache/incubator-pagespeed-mod/issues/1851#issuecomment-939403244


   Note I have come across another configuration that can cause this error:
   
   Nginx Load Balancer --- proxy_protocol -> Backend Nginx
   
   Two issues:
   
   1) pagespeed will attempt to perform a standard http/https request to the 
`proxy_protocol` port unless you use `MapOriginDomain` to remap it to a port 
that is not using `proxy_protocol`.
   2) pagespeed will fail to fetch resources via HTTPS due to lack of IPv6 
support when the backend server has no IPv6 network
   
   The solution in my instance was to configure two servers like so:
   
   ```nginx
   server
   {
     listen      8443 ssl http2 proxy_protocol;
     listen [::]:8443 ssl http2 proxy_protocol;
     port_in_redirect off;
     real_ip_header proxy_protocol;
     pagespeed MapOriginDomain http://localhost:8080 https://www.example.com 
www.example.com;
     root /home/example/public_html;
   }
   
   server
   {
     listen localhost:8080;
     root /home/example/public_html;
   }
   ```
   
   The reason for the second server is so that any dynamic processing via PHP, 
etc... doesn't get bypassed by using direct file access. This is not shown in 
the above example. This is also faster then performing another HTTPS request as 
there is no need to perform any encryption, nor is there any risk as the second 
server is only allowing loopback connections on localhost.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@pagespeed.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to