drupal-with-nginx
drupal-with-nginx copied to clipboard
fastcgi_cache_key including $http_x_forwarded_proto ?
I didn't create a pull request for this because the solution I came up with is ugly.
As mentioned in issue #125 , I'm using Nginx behind load balancers and utilizing X-Forwarded-Proto because I have SSL on the balancers instead of Nginx. I soon found that my https pages weren't returning any assets in Chrome until I turned off the microcache. This is because the microcache was created with http://, so images and stylesheets didn't have https://, and Chrome doesn't load mixed-mode content.
I found pull request #103 and applied similar logic:
## The cache key.
fastcgi_cache_key $http_x_forwarded_proto$scheme$host$request_uri;
I'm not proud of it, but it works for me. I figured I'd bring this up in case others use load balancers in front of Nginx and use X-Forwarded-Proto and microcaching. Maybe it's an edge case, but you also may have a better solution to this for others.