Michal Biros
Michal Biros

Reputation: 435

How to set portlet:resourceURL to output https URL?

I have page which can be requested as HTTP and HTTPS. The problem is that if user request page as HTTPS, images are still loaded from HTTP location.

How to setup <portlet:resourceURL> in JSP to output HTTPS url?

Upvotes: 0

Views: 441

Answers (1)

Olaf Kock
Olaf Kock

Reputation: 48057

If you request in https, <portlet:resourceURL/> will use https as well - works for me.

I guess you might have an Apache in front and forward requests with mod_proxy on http? This way Apache terminates the https connection and Tomcat/Liferay does not have any idea that you're using https between the browser and Apache. mod_proxy has some options to forward that information as well. I personally favor mod_jk, this will automatically forward all the relevant information and works quite well.

If I remember correctly, you can also configure the tomcat connector (e.g. 8080) to assume that it's served through https always. It might be secure="true" in the Connector element in server.xml, but I've not tested, just remembered vaguely

Upvotes: 1

Related Questions