Score:0

Nginx running site out of wrong folder

cn flag

On my Debian 10 VPS I have a MediaWiki deployment that I'm hosting on wiki.myorg.com stored on the filesystem using a soft link to manage versions like this:

/var/www/mediawiki/1.34.4
/var/www/mediawiki/1.38.2
/var/www/wiki -> /var/www/mediawiki/1.38.2

Then in nginx.conf I have the configuration pointing the home directory of the site:

server {                                                                        
    listen 443 ssl;                                                             
    server_name wiki.myorg.com;
    # SSL config etc...

    root /var/www/wiki;                                                         
    index  index.php;
    # And so on...
}

This is where it gets weird.

The site has been working fine, until it fell over a few days ago and when I was trying to fix the problem nothing I did seemed to have any effect at all, even putting an exit statement in the core settings file. Increasingly baffled, I ended up doing the same to the other folders and to my surprise when I changed the one in /var/www/mediawiki/1.34.4 it suddenly killed the site.

It seems as though nginx has been serving out of that folder the whole time. When I first set it up that was the home path, but as I upgraded the software I repointed the /var/www/wiki link to point at the new version.

A grep of my nginx folder cannot find any mentions of 1.34.4 in any configuration file, the /var/www/wiki folder is pointed at the /var/www/mediawiki/1.38.2 and nginx has been restarted a number of times over this period, including after any time I repointed the wiki link.

I ran into this problem because of an expired token on the site, which I couldn't update because I was updating the wrong folder, but as an added layer of strangeness, when I tried switching to PHP 8 instead of 7.3 it was serving out of the correct folder. It was only when I switched back to PHP 7.3 (turns out a bunch of the MediaWiki plugins I am using are way behind the curve) that this seemed to happen. The switch in this case was made by pointing the nginx config at a different php version for the site.

I have never run into anything like this before, it feels completely illogical. What is going on?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.