Foreman Proxy doesn't inherits the port from Foreman API

Problem:
I’m trying to change the default Foreman port from 443 to 8043, but the proxy still tries to talk to 443…

Expected outcome:

The proxy should also talk to 8043

Foreman and Proxy versions:
foreman-3.10.0
foreman-proxy-3.10.0

Foreman and Proxy plugin versions:

Distribution and version:
RHEL 9

Other relevant data:
I have added debug files and log files to this case: Bug #37670: Change of primary port makes Foreman Proxy fail - Foreman