NginxProxyManager / nginx-proxy-manager

Docker container for managing Nginx proxy hosts with a simple, powerful interface
https://nginxproxymanager.com
MIT License
23.37k stars 2.71k forks source link

After X number of minutes, NPM stops executing Custom Nginx Configuration #3435

Open matthewpomar opened 10 months ago

matthewpomar commented 10 months ago

Checklist

Describe the bug I as looking for a way to setup a redirect of a subdomain host to a different subdomain host, as well as map a specific page from the old subdomain to the new subdomain, but at a different relative path.

So, I have setup a Redirect Host, like:

help.example.com -> support.example.com

This works great!

However, I need to map an individual path from the old host to the new host a different location, something like:

http(s)://help.example.com/entries/12345678-Become-a-Rockstar to https://support.example.com/hc/en-us/sections/987654321-Become-A-Rockstar

So I created a new Custom Nginx Configuration for this part:

location = /entries/12345678-Become-a-Rockstar {
    return 301 "https://support.example.com/hc/en-us/sections/987654321-Become-A-Rockstar"; 
}

After saving the rule, both scenarios work perfectly. Then after 10 to 15 minutes or so, the Custom Nginx Configuration stops working and only the base redirect will work.

Nginx Proxy Manager Version v2.10.4

To Reproduce Steps to reproduce the behavior:

  1. Setup Redirect Host as described above
  2. Test redirect scenarios..
  3. Wait 30 mins to a few hours
  4. Observe problem

Expected behavior I would expect the Custom Nginx Configuration rule to work every time.

Screenshots NA

Operating System Using Docker on Synology NAS.

Additional context NA

matthewpomar commented 10 months ago

Today I observed that the correct redirection worked for the last few days, but then started to send the visitors to the wrong URL again, and now a few hours later, is working again.

matthewpomar commented 10 months ago

More info. After deleting and recreating the rule, it works again. But just for a little while, then is stops working. What is happening is the custom configuration starts getting ignored after some time passes. So, when I go here:

https://help.example.com/entries/12345678-Become-a-Rockstar

Instead of going here (like is does after I create the rule and for a while after that):

https://support.example.com/hc/en-us/sections/987654321-Become-A-Rockstar

It reverts to being redirected here:

https://support.example.com

The only way to stop this is to delete the rule and recreate the same example rule and it starts working again (for a little while).

I found the logs on /data but there's nothing useful to troubleshoot this.

Any suggestions?

fdmsh commented 10 months ago

Same situation here, external url fails after 20-30 minutes after start. If I just open the port without https, it stays stable. Logs show no errors. I also tried 2 mariadb containers, the problem is not in db.

matthewpomar commented 10 months ago

I also tried 2 mariadb containers, the problem is not in db.

@fdmsh I'm using the built-in sqlite database, so I can confirm as well that it doesn't appear db related.

It's the strangest problem. Appears to be random in nature. Perhaps there's a way to enable finer logging to see what's going on.

github-actions[bot] commented 2 months ago

Issue is now considered stale. If you want to keep it open, please comment :+1: