Express.js/Nginx hidden rewrite rule?

1 answer

So I am running an Express.js/Passport.js web server with Nginx on CentOS 7.

Here's the problem: I cannot display any endpoint that starts with w. Trying to do so results in a Cannot GET /wiki/Main_Page message. However, changing that same route from e.g. /welcome to /selcome works just fine.

Most likely culprit:

I installed Mediawiki but removed it not long after. IIRC there was some kind of setting that prettied up URLs that starting with /w after the domain. So I'm guessing a rewrite rule is persisting... just have no idea where.

Here are my config files:


module.exports = function(app, passport) {      //Changing the URLs below from welcome to selcome works fine     app.get('/activate', passport.authenticate('user-activate-account', {         successRedirect: '/welcome',         failureRedirect: '/404',         failureFlash: true     }));      ...      app.get('/welcome', isLoggedIn, function(req, res) {         res.render('inside', {              page_title: 'Welcome!',             inc_style: true,             style_sheet: 'style/dashboard.css',             portal: function() {                  return 'welcome';                }         });     }); }; 


user        nginx nginx; error_log   /var/log/nginx/error.log info;  # [ debug | info | notice | warn | error | crit ]  events {     worker_connections   1024; }  http {     include     mime.types;     include     /etc/nginx/sites_enabled/.conf;   //Really *.conf but more readable this way     include     /etc/letsencrypt/options-ssl-nginx.conf;      server_names_hash_bucket_size 64;      # Compression - requires gzip and gzip static modules.     gzip on;     gzip_static on;     gzip_vary on;     gzip_http_version 1.1;     gzip_min_length 700;      # Compression levels over 6 do not give an appreciable improvement     # in compression ratio, but take more resources.     gzip_comp_level 6;      # IE 6 and lower do not support gzip with Vary correctly.     gzip_disable "msie6";     # Before nginx 0.7.63:     #gzip_disable "MSIE [1-6]\.";      # Redirect http traffic to https     server {         listen      80 default_server;         server_name _;          return      301 https://$host$request_uri;     }      # Catch-all server for requests to invalid hosts.     # Also catches vulnerability scanners probing IP addresses.     server {             listen      443 ssl;         server_name bogus;         root        /var/empty;          return      444;          location / {             try_files $uri $uri/ =404;         }         }      # If running php as fastcgi, specify php upstream.     upstream php {         server      unix:/var/run/php7.2-fpm.socket;     } } 

/etc/nginx/sites_available/ server {     ssl_certificate     /etc/letsencrypt/live/;    # managed by Certbot     ssl_certificate_key /etc/letsencrypt/live/;      # managed by Certbot      listen          443 ssl;     server_name;      access_log      /var/log/nginx/;     error_log       /var/log/nginx/;      location /something\.js {         alias       /var/www/html/;          location ~* \.(gif|jpe?g|png|svg|webm)$ {             try_files   $uri =404;             expires     30d;         }     }      location / {             proxy_pass          http://localhost:3847;             proxy_http_version  1.1;             proxy_set_header    Upgrade $http_upgrade;             proxy_set_header    Connection 'upgrade';             proxy_set_header    Host $host;             proxy_cache_bypass  $http_upgrade;     } } 

So far I have

  • Purged Nginx config files, and every config file in the include tree, of any legacy rules.
  • Cleared Nginx cache
  • My node.js project folder does not even contain the string wiki anywhere except for NPM links in the node_modules folder.
  • All the PHP files in /etc, /etc/php.d, /etc/php-fpm.d do not contain the string wiki
  • Deleted mediawiki folder
  • Restarted nginx
  • Restarted php-fpm
  • Restarted entire machine

I'm genuinely baffled at where this problem could be. Any ideas?

Received answer to this question:
The best answer according to the author of the question:

Turns out it was the browser. Despite clearing history multiple times and using incognito mode, nothing changed. But using another browser worked flawlessly. I feel like an idiot, but at least I can finally put this rage-inducing mystery behind me.

Was using: Firefox (I guess private mode isn't enough) Chrome showed it was a browser error.