<div dir="ltr">Hi Francis,<div>Thanks for the reply and willingness to help me.<br></div><div><br></div><div>[root@proxy conf.d]# cat teste.conf<br>upstream webgateway {<br> server <a href="http://192.168.239.151:9090">192.168.239.151:9090</a>;<br> server <a href="http://192.168.239.152:9090">192.168.239.152:9090</a>;<br>}<br><br>server {<br> listen 9191;<br> proxy_pass webgateway;<br>}<br>[root@proxy conf.d]#<br></div><div><br></div><div>I cannot start NGINX.<br></div><div><br></div><div>Feb 15 01:56:24 proxy.lab.local systemd[1]: Starting The nginx HTTP and reverse proxy server...<br>Feb 15 01:56:24 proxy.lab.local nginx[12274]: nginx: [emerg] "proxy_pass" directive is not allowed here in /etc/nginx/conf.d/teste.conf:8<br>Feb 15 01:56:24 proxy.lab.local nginx[12274]: nginx: configuration file /etc/nginx/nginx.conf test failed<br>Feb 15 01:56:24 proxy.lab.local systemd[1]: nginx.service: control process exited, code=exited status=1<br>Feb 15 01:56:24 proxy.lab.local systemd[1]: Failed to start The nginx HTTP and reverse proxy server.<br>Feb 15 01:56:24 proxy.lab.local systemd[1]: Unit nginx.service entered failed state.<br>Feb 15 01:56:24 proxy.lab.local systemd[1]: nginx.service failed.<br></div><div><br></div><div>I can only start NGINX if the file is as below.<br></div><div><br></div><div>upstream webgateway {<br> server <a href="http://192.168.239.151:9090">192.168.239.151:9090</a>;<br> server <a href="http://192.168.239.152:9090">192.168.239.152:9090</a>;<br>}<br><br>server {<br> listen 9191;<br><br></div><div> location / {<br> proxy_set_header Host $host;<br> proxy_set_header X-Real-IP $remote_addr;<br> proxy_pass <a href="http://webgateway">http://webgateway</a>;<br> }<br>}<br></div><div><br></div><div>The behavior on the client is the same. <br>I can load HTTP page and cannot HTTPS. On the Web Gateway, I view the access logs with the client's IP.<br></div><div><br></div><div>In tests, I noticed that the "http_pass" below the "listen", I can't start NGINX.<br></div><div>I had to also put it as "http" or <a href="http://webgateway">http://webgateway</a>;<br></div><div><br></div><div>If you don't put the parameters below, the proxy tries to load the page <a href="http://webgateway">http://webgateway</a>.<br></div><div>proxy_set_header Host $host;<br></div><div><br></div><div>The parameter below registers the IP-Real of the client in the proxy.<br></div><div>proxy_set_header X-Real-IP $remote_addr;<br></div><div><br></div><div>Any tips? Thank You.</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Em ter., 15 de fev. de 2022 às 11:16, Francis Daly <<a href="mailto:francis@daoine.org">francis@daoine.org</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue, Feb 15, 2022 at 10:29:50AM -0300, Carlos Renato wrote:<br>
<br>
Hi there,<br>
<br>
> My file is like this.<br>
<br>
Untested by me, but I have edited this to now resemble what I think<br>
you want...<br>
<br>
> upstream webgateway {<br>
> server <a href="http://192.168.239.151:9090" rel="noreferrer" target="_blank">192.168.239.151:9090</a>;<br>
> server <a href="http://192.168.239.152:9090" rel="noreferrer" target="_blank">192.168.239.152:9090</a>;<br>
> }<br>
> <br>
> server {<br>
> listen 9191;<br>
> proxy_pass webgateway;<br>
> }<br>
<br>
...that is, keep your upstream{} but remove the keepalive; adjust your<br>
server{} to just have "listen" and a different "proxy_pass"; and put<br>
the whole thing inside "stream{}" not "http{}".<br>
<br>
> I'm able to open HTTP requests in the client's browser.<br>
> The problem is being the HTTPS requests.<br>
> Is there any way for NGINX to receive the traffic and forward it (balanced)<br>
> to the proxy servers?<br>
> A simpler way. That way I could include the Web Gateway certificate in the<br>
> Windows client.<br>
<br>
If I have understood correctly what you are trying to do, the notes at<br>
<a href="https://docs.nginx.com/nginx/admin-guide/load-balancer/tcp-udp-load-balancer/" rel="noreferrer" target="_blank">https://docs.nginx.com/nginx/admin-guide/load-balancer/tcp-udp-load-balancer/</a><br>
look relevant. That expands on what is at<br>
<a href="http://nginx.org/en/docs/stream/ngx_stream_core_module.html" rel="noreferrer" target="_blank">http://nginx.org/en/docs/stream/ngx_stream_core_module.html</a>.<br>
<br>
Cheers,<br>
<br>
f<br>
-- <br>
Francis Daly <a href="mailto:francis@daoine.org" target="_blank">francis@daoine.org</a><br>
_______________________________________________<br>
nginx mailing list -- <a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
To unsubscribe send an email to <a href="mailto:nginx-leave@nginx.org" target="_blank">nginx-leave@nginx.org</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"> <br><br></div>