Mini Profiler Resources doesn't respect subfolder

Hey guys,

This is another subfolder police public announcement.

Somewhere between 1.4.0 stable and 1.5.0.beta.8 mini profile resource url forgot how to deal with subfolders.

I’m searching for the culprit commit (between Discourse repo and Mini Profiler repo) just adding this post here so I don’t forget (because it’s Carnival in Brazil :confetti_ball:)

5 Likes

Scratch that, this is actually a bug in Mini Profiler, I will get it fixed if possible.

1 Like

It is actually very easy to work around in the top level server’s configuration. I had this issue and solved it by adding this line to my NGINX config:

rewrite ^/mini-profiler-resources/(.*)$ /forum/mini-profiler-resources/$1 permanent;

Here are a couple more redirects I ended up making. Perhaps it will be useful to someone:

rewrite ^/letter_avatar_proxy/(.*)$ /forum/letter_avatar_proxy/$1 permanent;
rewrite ^/login-preferences$ /forum/login-preferences permanent;
rewrite ^/sidekiq/(.*)$ /forum/sidekiq/$1 permanent;
3 Likes

Yes, I knew that, but no luck finding the commit that broke it on the time interval it affected me. Maybe was a subtle change?

This caused it all to happen… :frowning:

https://github.com/MiniProfiler/rack-mini-profiler/issues/25

2 Likes

This is apparently still broken so re-opening.

Looks like mini_profiler is not happy with subfolder installs. Unfortunately, I can’t say if this was fixed and is a regression or was never fixed. Haven’t had a subfolder install to look at in a while.

Really you should be looking at this @sam

Fixed per:

https://github.com/discourse/discourse/commit/17f75bc95e61e60fd5b7a20b5e303b108357badd

3 Likes