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

Amila Gunathilaka amila.kdam at gmail.com
Tue May 18 01:59:20 UTC 2021


>
> Hello All !


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),

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).

Is anyone familiar with this kind of problem?  my nginx configuration file
is below.

http {
    server {
listen 80  proxy_protocol;
        #listen [::]:80 proxy_protocol;
        server_name 172.25.234.105;
set_real_ip_from 172.25.234.2;
real_ip_header proxy_protocol;

        location / {
            proxy_pass http://127.0.0.1:9091;
   #proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection 'upgrade';
   proxy_set_header Host $host;
   proxy_set_header X-Real-IP       $proxy_protocol_addr;
   proxy_set_header X-Forwarded-For $proxy_protocol_addr;
   proxy_cache_bypass $http_upgrade;
            auth_basic "PROMETHEUS PUSHGATEWAY Login Area";
            auth_basic_user_file /etc/nginx/.htpasswd;
        }
    }
}

--
Amila
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20210518/f4d248f5/attachment.htm>


More information about the nginx mailing list