0

I have the following location directive in a dockerized machine

server {
        listen 80;

        location ~* ^/openchain/ {
            rewrite ^/openchain/(.*) /$1 break;
            proxy_pass http://0.0.0.0:8080;

            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
        }

        location / {
            root /usr/share/nginx/html;
        }

    }

But when I try to access the url http://192.168.99.100/record/?key=29189392 I get a 502 Bad Gateway error which is a result of

7#7: *1 connect() failed (111: Connection refused) while connecting to upstream

I'm not sure what I have wrong here....is the location regex correct?

Kendall
  • 247
  • 1
  • 3
  • 13

1 Answers1

0

To me it doesn't seem to be a problem with the regex but rather with the target you try to proxy the request to.

Could you please check, whether

  1. there is a process running which listens on port 8080
  2. your firewall accepts connections to port 8080 on loopback?
randomnickname
  • 513
  • 2
  • 11