Can we please do something to cause lines such as this to work properly in production?
rewrite ^/themes/([^/]+)$ /themes/$1/ permanent;
The problem is that using a relative redirect like that causes nginx to prefix it with
$scheme://$http_host, which is fine, but now with forced-https, is causing extra redirects. On web nodes, It happens because
'http'. It appears that the correct way of fixing this is to use
proxy_redirect on the SSL-terminating load balancers.
I’m unable to test LB changes, but it looks like this line should do the job
proxy_redirect http://$http_host/ https://$http_host/;
I’ve tested it on my own nginx install, in the reverse (rewriting ssl Location headers to http), and it appears to work as expected, but I’ve never used it before.
$http_host variable seems safe, since any relative redirects have to be to the current domain anyway.
A curl request to duplicate:
curl -I 'https://wordpress.org/themes/twentyfourteen?'