Skip to content

Wrong virtual host mapping after server reboot (domains showing incorrect site) #403

@cod3rshotout

Description

@cod3rshotout

Description

Hi,
I’m using nginx-proxy-automation on a Linux server running Docker, and I’ve noticed an intermittent issue:
after a full server reboot, some domains occasionally serve the wrong website, meaning the vhost mapping becomes incorrect.

Example scenario:

  • site-a.com unexpectedly shows the content of site-b.com
  • Restarting the affected container or reloading nginx fixes the issue temporarily

This doesn’t happen after every reboot, only sometimes.


Expected behavior

Each domain should always route to the correct container after the host system reboots.


Actual behavior

After reboot:

  • Wrong container is served for one or more VIRTUAL_HOST domains
  • It looks like nginx-proxy loads an outdated or incomplete configuration
  • Running nginx -s reload inside the proxy container fixes the issue
  • Restarting the app container also fixes it

Possible causes (hypothesis)

  • Race condition: proxy starts before all containers are alive
  • Old config not fully refreshed on startup
  • Docker network not ready when proxy boots
  • Exited/ghost containers being detected by nginx-proxy
  • Missing forced reload when containers attach to the proxy network

What I’ve tried

  • Added restart: always to all containers
  • Ensured all containers have unique VIRTUAL_HOST, LETSENCRYPT_HOST, VIRTUAL_PORT
  • Added depends_on so apps start before proxy
  • Running docker exec nginx-proxy nginx -s reload solves it
  • Cleaned up stopped containers (docker container prune)
  • Checked Docker networks (no duplicates or recreations)

Questions

  1. Is this a known issue related to container startup order?
  2. Is there a recommended way to force nginx-proxy to wait until all services are up?
  3. Should an automatic nginx -s reload be triggered after boot?
  4. Are there debug logs or flags that can help identify why config generation fails?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions