Francis Daly
May 19, 2021 04:28AM
On Tue, May 18, 2021 at 07:29:20AM +0530, Amila Gunathilaka wrote:

Hi there,

I'm not entirely sure what your setup is, so I will describe what I
think you have; please correct me where I am wrong.

> I have nginx installed on my linux host and* listen on http port 80* and I
> want to bypass external traffic coming from external load balancer
> (up-stream server) into my *nginx reverse proxy server (80 port) *and want
> to bypass that http traffic into y application running in a docker
> container (application host port 9091),

I think you have "the client" (which is "the user with the web browser");
which makes a http request to "the external load balancer". That talks to
your nginx, which expects a proxy_protocol-then-http request. And nginx
makes a http request to "the container application", on 127.0.0.1:9091

> But my nginx configuration file didn't work as it always says *405 method
> not allowed* error when request passing from nginx into the external load
> balancer (up-stream server).

In nginx terms, in the setup I have described above, "upstream" is "the
container application", not the external load balancer. That won't affect
the problem, but might help searching the web for help.

So -- can you show an example request that does not give the response
that you want?

Some thing like

curl -v http://load-balancer/whatever

will probably be helpful as a start. Feel free to remove any names or
addresses that you consider private, before pasting the response.

Right now, it is not clear to me if the 405 is coming from the load
balancer, from nginx, or from the container application. The fix will
likely be different in each case.

Possibly the logs from each of the servers will indicate how far things
get, and where they first fail. You might spot something obvious in there,
if you can easily find them.

Good luck with it,

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Help: Using Nginx Reverse Proxy bypass traffic in to a application running in a container

Amila Gunathilaka May 17, 2021 10:00PM

Re: Help: Using Nginx Reverse Proxy bypass traffic in to a application running in a container

Francis Daly May 19, 2021 04:28AM

Re: Help: Using Nginx Reverse Proxy bypass traffic in to a application running in a container

amiladevops May 29, 2021 09:42AM

Re: Help: Using Nginx Reverse Proxy bypass traffic in to a application running in a container

Francis Daly June 01, 2021 02:56AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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