Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Javascript being loaded using the wrong protocol
Hi
I have inherited a Liferay installation which I know absolutely nothing about... We are updating the infrastructure and are currently replacing the apache reverse proxy to a NGINX one. All the sites have been moved over without any problems except the LifeRay one... What we are getting is a lot (about 100) calls to the HTTP protocol and not HTTPS as it should be. The calls all look like this:
http://xxx.xxx.xxx/o/frontend-js-metal-web/metal-events/src/EventEmitter.js?languageId=en_US
http://xxx.xxx.xxx/o/frontend-js-metal-web/metal-events/src/events.js
http://xxx.xxx.xxx/o/frontend-js-metal-web/metal-dom/src/DomEventEmitterProxy.js?languageId=en_US
which gives us the error: Blocked loading mixed active content => this makes sense as we are going from a HTTPS site and trying to load HTTP js files. I am assuming that somewhere in the CMS somebody mistakenly added the protocol to the link i.e. http://xxx.xx.xxx instead pf just xxx.xx.xxx
I have looked through the entire frontend but cannot seem to find the place that these .js files are added – any ideas?
Thank you in advance
PS: I (unfortunatly) have no installation instructions for LifeRay i.e. I do not know what was installed where!
That's a core Liferay module. My guess would be to try this first if
the site isn't configured for SSL:
https://liferay.dev/blogs/-/blogs/ssl-configuration-in-liferay-https-
That may kick the core modules to load over SSL.
The URLs are generated by the app server, e.g. Tomcat.
Tomcat must be aware that the request is served through https - an information that can get lost when a reverse proxy is handling the TLS part and then forwards to Tomcat using http.
There are multiple ways to tackle this problem - e.g. making the proxy forward the information, declaring on Tomcat's site that a request is secure (despite Tomcat's better knowledge). I can't tell how to do it on nginx, but most likely you're running into this issue. It's a common problem in the reverse-proxy-world.
Powered by Liferay™