Issue with Port Mapping in Activation Emails - Reverse Proxy Environment (80 to 8080)

I am currently developing a system (HRMIS-SM) using PHPMaker on an Ubuntu environment.

The application is hosted behind a Reverse Proxy. External traffic hits the proxy on Port 80, but the internal Apache server, where the PHPMaker project resides, listens on Port 8080.

The Problem: When the system generates activation emails, the $ActivateLink variable includes the internal port (:8080) in the URL (e.g., http://hrmis-sm.health.gov.lk:8080/activate). This causes the links to fail for external users.

Current Environment Details:

  • Operating System: Ubuntu

  • Web Server: Apache (Listening on 8080)

  • Proxy: Apache (Listening on 80)

  • PHP $_SERVER status: * HTTP_HOST: hrmis-sm.health.gov.lk

    • SERVER_PORT: 8080

What I have tried:

  1. Configured mod_remoteip and ProxyPreserveHost On in Apache.

  2. Attempted to manually override $_SERVER['SERVER_PORT'] = 80; in the Global Code section.

  3. The system still includes:8080 in the activation email links.

My Question: Is there a specific setting within the PHPMaker project (e.g., in the PHP -> General Options or a specific Server Event) that forces the application to ignore the internal port 8080 and use Port 80 for all generated URLs and email links?

You may simply replace $ActivateLink with the actual link in the email template.

Thank you.