Timeout if certificate configured in load balancing front-end

RT 5.0.5 behind a load balanced hardware that handles the SSL connections to the users.
Load balancers connect to RT to port 80 (only one front-end in a non-production server).
I can create a new lifecycle but when I try to edit any of them, I get a timeout.

I’ve found out that all lifecycle’s URLs point to http, not to https.

Analyzing the code in /opt/rt5/share/html/Admin/Lifecycles/index.html line 79 I’ve changed this:

<td class="collection-as-table"><a href="<% RT->Config->Get('WebURL') %>Admin/Lifecycles/Modify.html?Type=<% $lifecycles{$key}{'type'} ? loc($lifecycles{$key}{'type'}) : loc('ticket') |u%>&Name=<% $key %>"><% $key %></a></td>

to this:

<td class="collection-as-table"><a href="<% RT->Config->Get('WebPath') %>Modify.html?Type=<% $lifecycles{$key}{'type'} ? loc($lifecycles{$key}{'type'}) : loc('ticket') |u %>&Name=<% $key %>"><% $key %></a></td>

Basically, WebURL → WebPath and adapting the rest of the URL to this change.

Now It works.

I presume I have to do this change in more places so RT can work in my infrastructure unless I’ve configured something wrong.

I correct myself.
Initially, I configured $WebPort to 80 because RT is listening to port 80 but I have some issues in some pages that work with WebURL instead of WebPath (editing lifecycles, notifications sent from dashboard subscriptions, etc.).
I’ve changed $WebPort to 443 and now it’s working fine. Any URL in pages returned from RT point to https. It doesn’t matter if it’s listening on port 80.
I’ve left the code with WebURL again.

New configuration for SSO in Apache broke last config in RT. I realized that I missed to configure:
Set( $CanonicalizeRedirectURLs, 1 );
Now it’s working again.