Nginx page speed writes to http instead of relative urls serving behind load balancer

StackOverflow https://stackoverflow.com/questions/16485904

  •  21-04-2022
  •  | 
  •  

سؤال

I have a problem with Google's 'nginx page speed' plugin which writes the urls to http://example.com. I am using Elastic Load Balancer to map https to http on AWS.

I am finding the modified urls as http://example.com/sample.XXXXXXX.css. This works fine on http end points, but when I have https end point, the css is not working because of security/cross domain from http to https change.

Is there a way to make the page speed module to use relative urls instead of absolute ones ?

هل كانت مفيدة؟

المحلول

Setting the nginx config to use X-Forwarded-Proto via pagespeed RespectXForwardedProto on;

Source: https://developers.google.com/speed/docs/mod_pagespeed/https_support

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top