View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0009077 | mantisbt | administration | public | 2008-04-15 23:49 | 2009-06-23 15:28 |
| Reporter | ahalligan | Assigned To | jreese | ||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Product Version | 1.1.1 | ||||
| Target Version | 1.2.0rc1 | Fixed in Version | 1.2.0rc1 | ||
| Summary | 0009077: [PATCH] Mantis does not handle forwarded protocol correclty when behind a proxy | ||||
| Description | When I run mantis from behind a public proxy and forward https -> http, I experience a problem similar to issue# 0006134. I want to be able to have users access mantis securely from a public address https://mantis.mydomain.com and developers access mantis on the internal network at http://localserver/ To get things to work properly I simply tweaked the config_defaults_inc.php with the following (please also find patch attached): $t_protocol = 'http'; This has the system working in both scenarios. Would be great if this tweak could make its way into the next release. | ||||
| Tags | patch | ||||
| Attached Files | Forwarded Protocol.patch (672 bytes)
Index: mantisbt/config_defaults_inc.php
===================================================================
--- mantisbt/config_defaults_inc.php (revision 5166)
+++ mantisbt/config_defaults_inc.php (working copy)
@@ -69,7 +69,9 @@
# requires trailing /
if ( isset ( $_SERVER['PHP_SELF'] ) ) {
$t_protocol = 'http';
- if ( isset( $_SERVER['HTTPS'] ) && ( strtolower( $_SERVER['HTTPS'] ) != 'off' ) ) {
+ if ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) ) { // Support ProxyPass
+ $t_protocol= $_SERVER['HTTP_X_FORWARDED_PROTO'];
+ } else if ( isset( $_SERVER['HTTPS'] ) && ( strtolower( $_SERVER['HTTPS'] ) != 'off' ) ) {
$t_protocol = 'https';
}
| ||||