PMA behind loadbalancer wrong redirect to port 80

Bug #1334324 reported by cidero
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
phpmyadmin (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Hi,

if we open https://example.com/phpmyadmin/ we see the login page. After filling out the details and clicking on login we get redirected to the wrong URL https://example.com:80/phpmyadmin/.

This bug was apparently already described in the bug reports #3538, #3692, #3704 and #4120 but either closed as fixed or invalid.
We use the latest version from the Ubuntu 12.04 repository: 4:3.4.10.1-1

The problem is that we use a loadbalancer in front of the webservers to distribute the load and to terminate the SSL connections. User-to-Loadbalancer is HTTPS and Loadbalancer-to-webserver is HTTP. Since PHPMyAdmin receives the request via HTTP it sets the port incorrectly to 80. In the config.inc.php we tried this settings:
$cfg['PmaAbsoluteUri'] ='https://example.com/phpmyadmin/';
$cfg['ForceSSL'] = true;

but in libraries/Config.class.php the following lines overwrite this:

        // Add port, if it not the default one
         if (! empty($url['port'])
           && (($url['scheme'] == 'http' && $url['port'] != 80)
             || ($url['scheme'] == 'https' && $url['port'] != 443))) {
             $pma_absolute_uri .= ':' . $url['port'];
         }

Deleting those lines fixed the issue for us. But with the next upgrade from the Ubuntu repository we will run into the same problem if this is not fixed...

Just created the same bug report at the upstream project: https://sourceforge.net/p/phpmyadmin/bugs/4474/

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in phpmyadmin (Ubuntu):
status: New → Confirmed
Revision history for this message
Michal Čihař (nijel) wrote :
Changed in phpmyadmin (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.