Welcome! Log In Create A New Profile

Advanced

Re: NGINX load balancing - Proxy

Francis Daly
February 15, 2022 11:52AM
On Tue, Feb 15, 2022 at 12:31:06PM -0300, Carlos Renato wrote:

Hi there,

> This what I get when trying to start NGINX with the simplified file.
>
> [root@proxy conf.d]# cat webgateway.conf
> upstream webgateway {
> server 192.168.239.151:9090;
> server 192.168.239.152:9090;
> }
>
> server {
> listen 9191;
> proxy_pass webgateway;
> }
> }

I suggest: remove or rename that webgateway.conf file, so that it will not
match whatever "include" line is already in your /etc/nginx/nginx.conf.

Then add those 10 lines to your /etc/nginx/nginx.conf, inside the
already-existing "stream{}" block; or create a new "stream{}" block
between the "events{}" block and the "http{}" block that are already in
your nginx.conf, and put those 10 lines inside that.


The reason is: when nginx runs, it reads one config file. That config
file might "include" some others. Typically, there is something like
"include /etc/nginx/conf.d/*.conf;" within the http{} block; but we do
not want to have this upstream-and-server config within http{}; it must
be within stream{}.

If your nginx binary does not include stream{}, then you probably want
to see about getting a new binary, if you want to use nginx to do the
thing that you want to do.

Good luck with it,

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list -- nginx@nginx.org
To unsubscribe send an email to nginx-leave@nginx.org
Subject Author Posted

NGINX load balancing - Proxy

crenatovb February 14, 2022 09:14PM

Re: NGINX load balancing - Proxy

Sergey A. Osokin February 14, 2022 10:56PM

Re: NGINX load balancing - Proxy

crenatovb February 15, 2022 06:44AM

Re: NGINX load balancing - Proxy

Francis Daly February 15, 2022 08:08AM

Re: NGINX load balancing - Proxy

crenatovb February 15, 2022 08:34AM

Re: NGINX load balancing - Proxy

Francis Daly February 15, 2022 09:18AM

Re: NGINX load balancing - Proxy

crenatovb February 15, 2022 10:18AM

Re: NGINX load balancing - Proxy

jvybihal February 15, 2022 10:28AM

Re: NGINX load balancing - Proxy

crenatovb February 15, 2022 10:36AM

Re: NGINX load balancing - Proxy

Francis Daly February 15, 2022 11:52AM

Re: NGINX load balancing - Proxy

crenatovb February 16, 2022 11:10AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 293
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