Attempting to resolve an issue that's been annoying me for a bit. I've distilled the symptoms into a set of reproducible steps:
I have two sites,
siteA
, andsiteB
. They are both Node.js applications running on different ports (for the sake of example,4567
and4568
)Both applications have their own file in
sites_available
(plus a symlink fromsites_enabled
), which contain the directivesproxy_pass http://node_siteA/
andproxy_pass http://node_siteB/
respectively, inside of alocation
block.They also each have an
upstream
block (defined globally?):upstream node_siteA { upstream node_siteB { server 127.0.0.1:4567; server 127.0.0.1:4568; } }
Site A and Site B have nothing to do with each other.
Yes, I am restarting (reloading, actually) nginx every time I make a change.
If I take down site B and attempt to access it via the web, I am served site A.
Why is this?
Thoughts
Other times, when I create a new
Site C
, for example, nginx refuses to show me anything except "Welcome to nginx!" for ~5 minutes. This suggests a resolver timeout, perhaps?When I access
Site B
after its config has been deleted, and it sends me toSite A
, this sounds like nginx sending me to servers in a round-robin fashion...
server
.SiteA
.SiteB
's config is exactly the same, only with "SiteB" substituted for "SiteA"