Issue embedding when discourse is hosted in a subfolder


(Kevin Glinski) #1

We’ve been running with discourse as a subfolder located at /forum and it has been working great. Now we want to embed comments on our blog on the same site located in /blog.

On the blog page, the iframe loads and displays “Loading Discussion…” but then doesn’t load it. Looking at the console, i see it requesting https://site/mini-profiler-resources/includes.js?v=12b4b45a3c42e6e15503d7a03810ff33 which returns a 404, when it should be requesting

https://site/**forum/**mini-profiler-resources/includes.js?v=12b4b45a3c42e6e15503d7a03810ff33

So i’m guessing that the logic behind DISCOURSE_RELATIVE_URL_ROOT isn’t being applied to the embedded page.

I’m trying to run this all on localhost behind a nginx reverse proxy but can’t figure out how to get vagrant to honor the DISCOURSE_RELATIVE_URL_ROOT property like in the docker config. If i can get this running, i can help diagnose and submit a PR

Thanks


(Sam Saffron) #2

Yeah mini profiler should be fixed so it works with subfolder, PR welcome.


(Kevin Glinski) #4

the issue with mini profiler is an issue, but not the issue that was causing the thread to not load, my discourseEmbedUrl was configured with double slashes in the url, moving to a single slash fixed my issue.


(Jeff Atwood) #5

I believe @neil tried to fix this once and could not, so you might be the best person to do it @sam.


(Joshua Rosenfeld) #7

For reference @sam


(Sam Saffron) #8

MiniProfiler seems to work fine with subfolder for me, using it in dev. Particular issue here was somehow it was being shipped on the embedded page, which I guess is right if you are viewing embed as admin with mini profiler enabled.

Not much to do here.