perftools / xhgui

Web interface for XHProf profiling data can store data in MongoDB or PDO database
1.65k stars 342 forks source link

redirects after run delete do not honor 'path.prefix' #424

Closed dadamssg closed 2 years ago

dadamssg commented 3 years ago

It appears that the path.prefix is only honored in the twig templates and not in the redirects from the backend. For example, the deleteSubmit() controller action redirects using the following, which simply redirects to the domain root, /.

$this->app->redirect($this->app->urlFor('home'));

If i'm hosting xhgui at https://mydomain.com/tools/xhgui/ and i have path.prefix set to /tools/xhgui/, after a delete i will be redirected to https://mydomain.com

Not a huge bug by any means but a minor annoyance.

glensc commented 3 years ago

PR adding the config support:

glensc commented 3 years ago

I think it's important how have you setup your webserver, I think your "alias" is set up incorrectly so that xhgui thinks it's installed at "/" while at webserver level it's at "/tools/xhgui".

you need to rewrite the incoming/outgoing requests equally.

In Apache, it's typically ProxyPassReverse:

dadamssg commented 3 years ago

ah, you may be right. I'm using nginx. i'll need to mess around with my nginx conf file

glensc commented 3 years ago

you may be right too, as I added the original change for assets to render properly. but then again, the 'home' route app should detect automatically how the app is installed.

you should post your nginx config here. it maybe something obvious, but otherwise maybe some other community member can have answer if they see the whole picture.

glensc commented 2 years ago

No longer an issue after slim upgrade:

In fact that slim added prefix needed to be reversed to prevent double paths:

Re-open (or create new issue) once 0.20.0 is released and this is still an issue (or is new issue).