View Issue Details

IDProjectCategoryView StatusLast Update
0013056mantisbtinstallationpublic2020-12-01 13:02
Reportersandor Assigned To 
PriorityhighSeverityblockReproducibilityalways
Status newResolutionopen 
PlatformMantis with reverse proxy Apache 
Product Version1.2.5 
Summary0013056: Url are coding with static path instead of relative path
Description

These url are coding with a static path :
/login_page.php
/login.php
/browser_search_plugin.php
/login_cookie_test.php
/my_view_page.php
/css
/javascript
/images
It only works if there are in the root directory whereas there are supposed to be in the mantis directory.
It works if these files does not contain a "/" caracter at the beginning.

Steps To Reproduce

install mantis with a reverse proxy :

|reverse proxy| <=> |application server| <=> |database server|

Additional Information

To use mantis with a proxy and don't move files and folders, we rewrite some code in 3 files. But we are not totally sure if it is the best solution.

Mantis\config_inc.php
line 13
// modif proxy
$g_path = '';
$t_url = '';

Mantis\core\string_api.php
line 292
//return $t_path . '/' . $t_script . $t_query . $t_anchor;
// modif proxy
return $t_path . $t_script . $t_query . $t_anchor;

Mantis\core\helper_api.php
line 482
//return config_get_global( 'short_path' ) . $p_url;
// modif proxy
return $p_url;

TagsNo tags attached.

Relationships

related to 0009333 new Wrong protocol when using Apache mod_proxy as a reverse proxy to access a Mantis service. 
related to 0024860 new Refused to load the stylesheet '<URL>' 

Activities

sandor

sandor

2011-07-08 10:52

reporter   ~0029136

Last edited: 2011-07-08 10:54

ProxyPass /mantis/ https://proxy/
ProxyPassReverse /mantis/ https://proxy/
for a total access of mantis with a proxy url must be rewrite with the /mantis/ path

resolution in config_defaults_inc.php, line 119 :

if ( isset( $_SERVER['HTTP_X_FORWARDED_HOST'] ) ) {
$t_path = '/mantis/';
}
$t_url = $t_protocol . '://' . $t_host . $t_path;

lbayle

lbayle

2013-05-20 11:36

reporter   ~0036907

related to 0009333 ?

g4uti3r

g4uti3r

2018-07-06 08:57

reporter   ~0060223

Hi, I saw this old issue and I have the exact same problem.

Setting the variables to "$g_path" "$t_url" to an empty string solves the issue of the proxy access, however it raises another issue regarding the email notifications.

E.g: here's what an account confirmation link sent via e-mail looks like: "verify.php?id=16&confirm_hash=uc0yto1gDYo3VB0GH7639MpNeOXAiBVraM0xAyMh8__O6eF-WsCVt7Py5KnqpKcs9SpNkXAPPP22nk9zuGk0".

Why isn't Mantis built on relative paths ?

sarodude

sarodude

2019-02-06 12:30

reporter   ~0061422

Committed / pushed a change: https://github.com/mantisbt/mantisbt/pull/1459

sarodude

sarodude

2020-12-01 13:02

reporter   ~0064728

@dregad - changes checked in nearly 2 years past. how does someone review? there's an existing pull request.