Didn't {DOCROOT} add a final slash at the end? [SOLVED]

Discussion in 'General' started by Gwyneth Llewelyn, Jul 9, 2025.

  1. Hi,

    This is just a sanity check...

    Until very recently (at worst, a few patches back), I was quite sure that {DOCROOT} on the Directive Snippets for Nginx would add a trailing slash at the end — that's how all my configurations have been done since the dawn of ages, eons ago. And the reason was simple — while Nginx had no issue with double slashes in paths, for aesthetical purposes, I didn't like those!
    Today, I was tinkering with my overall configuration (every now and then, I attempt to get HTTP/3 working ☺️), and noticed that one of the vhost config files was missing the trailing slash when including a per-vhost file (usually called nginx.conf and directly written by a few WordPress plugins by default). I thought that I had deleted it manually by mistake. Then I noticed that most entries were missing that slash as well. Going back to the Directory Snippets, in order to find if some of those got broken by mistake, I noticed that there weren't any changes.

    And then I finally realised that all vhost config files had the same issue, across different templates and/or Directive Snippets — so the problem was just that I used to assume that {DOCROOT} did always add an extra slash at the end — but now, all of a sudden, it doesn't any longer!

    Well, perhaps not quite "all of the sudden". I have seen several recent threads — and not-so-recent ones — which clearly always add the extra slash, so, one might presume that this behaviour has been consistently that way for a while now. I wonder... when was this behaviour changed?

    Or it just happens that... it never changed... it's just that for some very obscure reason my configuration happened to behave unexpectedly?

    Or maybe even... it's related to a PHP upgrade, and not to ISPConfig3 at all? (That would certainly explain the difference!)

    Or... it's now something we can edit/configure from the control panel... it just happens that the 'default' setting is 'no trailing slash, but there is an option hidden somewhere which triggers the change — with the default being 'no trailing slash' (to be more consistent to similar logic in many other templating platforms dealing with paths).

    I'm really just wondering, nothing more. I don't even want to switch back! (I actually prefer {DOCROOT} not to add that final slash!) So long as this is the 'new' (new?) default behaviour, I'm happy!

    I was just wondering for how long this has changed to roughly estimate for how long my websites have been missing some additional protection requiring that {DOCROOT}/nginx.conf was correctly being included...
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    We fixed a bug there some time ago that caused a double slash to be added, which might have changed that, but I can't say exactly when that was. You might be able to look it up in the git log, though.
     
    Gwyneth Llewelyn likes this.
  3. Ah, great, @till — so I haven't become insane and/or senile yet :)
    Thanks for fixing that!
     

Share This Page