Welcome! Log In Create A New Profile

Advanced

Re: nginx serving wrong proxy content, static assets not affected

Ángel
January 05, 2023 07:36PM
On 2023-01-03 at 20:54 +0000, Eduardo Kortright wrote:
> I have no idea what triggers this behavior. Once it happens, the only
> thing that can be done to correct it is to restart nginx. After that
> (could be minutes, hours, or days), the server will function as
> expected once again. Since I am using this setup in several
> production servers, at first I created a cron job to restart nginx
> every day, then every hour, and finally I decided to poll the sites
> on each server every five minutes, so that if the responses don’t
> look right I can restart nginx without having users experience a
> lengthy interruption.

Did you try reload instead of a restart? That's usually enough for
getting nginx update the sources, and is transparent to your users.


As for the actual problem, as I understand you have 4 docker
containers:
- aaa.com (Rails app)
- bbb.com (Rails app)
- ccc.com (Rails app)
- proxy (nginx, with the static assets for the 3 sites)

Do the ip addresses for the rails sites change over time?
Mind that nginx will query the hostname only once (at startup/reload),
*and use that same ip forever*
If the other containers switched ips, that would produce the exact
behavior that you are seeing.

You can force nginx to requery dns by using a variable
see https://forum.nginx.org/read.php?2,215830,215832#msg-215832


_______________________________________________
nginx mailing list
nginx@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

nginx serving wrong proxy content, static assets not affected

Eduardo Kortright January 04, 2023 03:34PM

Re: nginx serving wrong proxy content, static assets not affected

unclepieman January 04, 2023 04:38PM

Re: nginx serving wrong proxy content, static assets not affected

Eduardo Kortright January 06, 2023 03:52PM

Re: nginx serving wrong proxy content, static assets not affected

Ángel January 05, 2023 07:36PM

Re: nginx serving wrong proxy content, static assets not affected

Eduardo Kortright January 05, 2023 08:56PM

Re: nginx serving wrong proxy content, static assets not affected

Eduardo Kortright January 06, 2023 03:48PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 243
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready