Behind a proxy that terminates TLS without X-Forwarded-Proto, Rails sees http while the page is https, and an http source on a non-default port doesn't match. A source without a scheme takes the page's own.