When PhpBB is hosted behind a SSL offloading Proxy $server_port from common.php does not take header HTTP_X_FORWARDED_PORT into account...
The same problem appear with OAuth /public/vendor/lusitanian/oauth/src/OAuth/Common/Http/Uri/UriFactory.php with function detectPort
This can be observed when hosting PhpBB using Red Hat OpenShift (There is a Free Trial for Testing...)
The Apache advertised SERVER_PORT value is always 80 when hosted behind OpenShift Reverse Proxy even when using HTTPS over port 443 (SSL being deciphered before reaching the VMs)
This prevent OAuth from working correctly... (it tries to append port 80 to redirect URI in https...)