<div dir="ltr">Dear Francis,<br><br>I'm sorry for taking time to reply to this,  you were so keen about my problem. Thank you.  <br><br>Actually my problem was when sending <b>response </b>to the load balancer from the nginx ( not the request, it should be corrected as the <b>response </b>in my previous email).<br>Such as my external load balancer is always doing a health check for my nginx port (80) , below is the <b>response </b>message in the  /var/log/nginx/access.log  against the health check request coming from the external-loadbalancer. <br><br><img src="cid:ii_kp48fot90" alt="image.png" width="472" height="203"><br><br>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) . <br><br>server {<br>    listen       80;<br>    server_name  172.25.234.105;<br>    error_page 405 =200 $uri;<br>    location / {<br>        error_page 405 =200 $uri;<br>        proxy_pass <a href="http://127.0.0.1:9091">http://127.0.0.1:9091</a>;<br>        auth_basic "PROMETHEUS PUSHGATEWAY Login Area";<br>        auth_basic_user_file /etc/nginx/.htpasswd;<br>    }<br>}<br><br><br>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 ? <br><br>Thanks<br><br>Amila </div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 19, 2021 at 5:30 PM <<a href="mailto:nginx-request@nginx.org" target="_blank">nginx-request@nginx.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Send nginx mailing list submissions to<br>
        <a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
or, via email, send a message with subject or body 'help' to<br>
        <a href="mailto:nginx-request@nginx.org" target="_blank">nginx-request@nginx.org</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:nginx-owner@nginx.org" target="_blank">nginx-owner@nginx.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of nginx digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
   1. Re: Help: Using Nginx Reverse Proxy bypass traffic in to a<br>
      application running in a container (Francis Daly)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Wed, 19 May 2021 09:27:30 +0100<br>
From: Francis Daly <<a href="mailto:francis@daoine.org" target="_blank">francis@daoine.org</a>><br>
To: <a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
Subject: Re: Help: Using Nginx Reverse Proxy bypass traffic in to a<br>
        application running in a container<br>
Message-ID: <<a href="mailto:20210519082730.GA11167@daoine.org" target="_blank">20210519082730.GA11167@daoine.org</a>><br>
Content-Type: text/plain; charset=us-ascii<br>
<br>
On Tue, May 18, 2021 at 07:29:20AM +0530, Amila Gunathilaka wrote:<br>
<br>
Hi there,<br>
<br>
I'm not entirely sure what your setup is, so I will describe what I<br>
think you have; please correct me where I am wrong.<br>
<br>
> I have nginx installed on my linux host and* listen on http port 80* and I<br>
> want to bypass external traffic coming from external load balancer<br>
> (up-stream server) into my *nginx reverse proxy server (80 port) *and want<br>
> to bypass that http traffic into y application running in a docker<br>
> container (application host port 9091),<br>
<br>
I think you have "the client" (which is "the user with the web browser");<br>
which makes a http request to "the external load balancer". That talks to<br>
your nginx, which expects a proxy_protocol-then-http request. And nginx<br>
makes a http request to "the container application", on <a href="http://127.0.0.1:9091" rel="noreferrer" target="_blank">127.0.0.1:9091</a><br>
<br>
> But my nginx configuration file didn't work as it always says *405 method<br>
> not allowed* error when request passing from nginx into the external load<br>
> balancer (up-stream server).<br>
<br>
In nginx terms, in the setup I have described above, "upstream" is "the<br>
container application", not the external load balancer. That won't affect<br>
the problem, but might help searching the web for help.<br>
<br>
So -- can you show an example request that does not give the response<br>
that you want?<br>
<br>
Some thing like<br>
<br>
  curl -v <a href="http://load-balancer/whatever" rel="noreferrer" target="_blank">http://load-balancer/whatever</a><br>
<br>
will probably be helpful as a start. Feel free to remove any names or<br>
addresses that you consider private, before pasting the response.<br>
<br>
Right now, it is not clear to me if the 405 is coming from the load<br>
balancer, from nginx, or from the container application. The fix will<br>
likely be different in each case.<br>
<br>
Possibly the logs from each of the servers will indicate how far things<br>
get, and where they first fail. You might spot something obvious in there,<br>
if you can easily find them.<br>
<br>
Good luck with it,<br>
<br>
        f<br>
-- <br>
Francis Daly        <a href="mailto:francis@daoine.org" target="_blank">francis@daoine.org</a><br>
<br>
<br>
------------------------------<br>
<br>
Subject: Digest Footer<br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
<br>
------------------------------<br>
<br>
End of nginx Digest, Vol 139, Issue 21<br>
**************************************<br>
</blockquote></div>