Ajaxify interfering with links outside of NodeBB
-
@phenomlab Are you using nginx as reverse proxy? In that case, nginx should be set up to only ever direct requests to your forum, to your forum...
That's confusing, let me try again.
If your forum is
forum.example.com
, your nginx config should be set up to listen for requests toforum.example.com
and forward them to NodeBB. For ghost, you'll set up a different server block directing requests toblog.example.com
(orexample.com
) to ghost.That way there's no confusion.
If you're using a subfolder things get a little harder. You'd have to proxy requests to both ghost and nodebb from within the same server block.
So it would look something like this:
server { location /forum { ... proxy stuff for nodebb here } location /content { ... proxy stuff for ghost here } }
The issue now seems to be that NodeBB seems to be considering requests outside of its relative path to be part of NodeBB, which is incorrect. I don't think NodeBB should do that, but it might be a bug.
Can you confirm the reverse proxy config is correct?
-
@julian It's correct, yes, as Ghost works fine. However, I've worked around this by placing ghost into https://content.sudonix.com which works fine
-
@phenomlab @julian and now the issue I have is that previously published articles that I was tested with are recorded in the MongoDB. Is there a way these can be removed ? The problem here is that Ghost and NodeBB think they have been published when in fact they have not. I guess I need to modify the DB directly, but have no idea where to start with MongoDB
I thought that perhaps uninstalling the plugin and reinstalling would strip the older entries, but this does not work.
-
@julian A quick workaround would be to delete from the database and re-publish. The problem with that is I don't know how to do this - not being overly familiar with the intricate structure of MongoDB.
And, to be clear, I am now using Ghost at https://content.sudonix.com which works fine - the link to the actual article in the NodeBB post works as it should do, so it looks as though attempting to use a sibdirectory does not work owing to NodeBB's insistence that it should route that path internally
-
@phenomlab I'm trying this locally, and the routing seems fine...
If my forum is hosted on
/forum
and I make a link to/test/foobar
, clicking said link will attempt to open it as a new page, not internally.What did the link structure look like on your site before you switched Ghost over to
content.sudonix.com
? -
@julian See https://community.nodebb.org/post/86030 for the NGINX config.
-
@phenomlab If you want to blow up the internal hash for blog comments, you can likely just delete the
blog-comments
object in Mongo. Back up your DB first, I have no idea what side-effects there will be.db.objects.deleteMany({ _key: "blog-comments" });
That key stores the Ghost comment ID reference to the topic ID.
-
@phenomlab Right, ok, I looked at the nginx config, and I can see that it is configured so NodeBB thinks it is at root level.
... which it is, which is why NodeBB thinks it owns
/content
and hence why it tries to ajaxify into it, because NodeBB does not expect a mounted route within NodeBB's realm of control that doesn't belong to NodeBB. -
@julian Fair enough - no issues for me - simply cosmetic, but not essential, so content.sudonix.com works fine for me.
Thanks very much for looking into this, and providing the database command.