Score:0

nginx redirects users to backend address on rare occasions

cn flag

We have an pretty standard nginx, Apache and PHP-FPM reverse proxy setup on Ubuntu 20 installed through ServerPilot.

Our nginx location context is configured simply as this:

    proxy_pass      $backend_protocol://$backend_host:$backend_port;
    add_header      'Access-Control-Allow-Origin' '*';

Those variables resolve to http://127.0.0.1:81

The site has been working flawlessly for several weeks and thousands of users.

However, we have two users who were accessing the frontend address (e.g. https://example.com), and for some reason I cannot discern, were redirected to the backend address and received this browser error. enter image description here

When these users do any of the following, loading the home page works as expected:

  • Open the Network Console and check "Disable cache"
  • Load the site in Incognito mode
  • The user goes to https://example.com/index.php (which is the only possible index page for the request)

However, even after successfully loading the home page through any of these methods, after quitting the browser and re-opening, the behavior returns - attempts to load the home page without 'index.php' get redirected to the backend server address for the two users.

My two questions:

  1. What could be causing this to happen, and very rarely?
  2. How can we clear this condition for users who are affected without having them dump their entire browser cache (which I'm not 100% confident will work anyway)?
Michael Hampton avatar
cz flag
Why do you believe this has anything to do with nginx? Such problems are usually caused by the backend application. Though in your case it could be Apache.
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.