nginx Digest, Vol 139, Issue 21
Amila Gunathilaka
amila.kdam at gmail.com
Tue May 25 16:17:47 UTC 2021
Dear Francis,
I'm sorry for taking time to reply to this, you were so keen about my
problem. Thank you.
Actually my problem was when sending *response *to the load balancer from
the nginx ( not the request, it should be corrected as the *response *in my
previous email).
Such as my external load balancer is always doing a health check for my
nginx port (80) , below is the *response *message in the
/var/log/nginx/access.log against the health check request coming from
the external-loadbalancer.
[image: image.png]
Below is my nginx config file I use for bypass traffic coming from external
load-balancer into the nginx port (80) and for bypass that traffic into my
app running in the same server (same server as nginx running) as a
container (app port 9091) .
server {
listen 80;
server_name 172.25.234.105;
error_page 405 =200 $uri;
location / {
error_page 405 =200 $uri;
proxy_pass http://127.0.0.1:9091;
auth_basic "PROMETHEUS PUSHGATEWAY Login Area";
auth_basic_user_file /etc/nginx/.htpasswd;
}
}
Please contact me for more information if you need. I believe I can
overcome this 405 http header response issue in the nginx config file ?
Thanks
Amila
On Wed, May 19, 2021 at 5:30 PM <nginx-request at nginx.org> wrote:
> Send nginx mailing list submissions to
> nginx at nginx.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://mailman.nginx.org/mailman/listinfo/nginx
> or, via email, send a message with subject or body 'help' to
> nginx-request at nginx.org
>
> You can reach the person managing the list at
> nginx-owner at nginx.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of nginx digest..."
>
>
> Today's Topics:
>
> 1. Re: Help: Using Nginx Reverse Proxy bypass traffic in to a
> application running in a container (Francis Daly)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 19 May 2021 09:27:30 +0100
> From: Francis Daly <francis at daoine.org>
> To: nginx at nginx.org
> Subject: Re: Help: Using Nginx Reverse Proxy bypass traffic in to a
> application running in a container
> Message-ID: <20210519082730.GA11167 at daoine.org>
> Content-Type: text/plain; charset=us-ascii
>
> 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 at daoine.org
>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
> ------------------------------
>
> End of nginx Digest, Vol 139, Issue 21
> **************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20210525/500fd702/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 43017 bytes
Desc: not available
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20210525/500fd702/attachment-0001.png>
More information about the nginx
mailing list