0

I want to connect to containers via nginx location blocks without making the port visible in the url for a large scale application my current block is:

location ~"/name/(.*)/(.*)/([0-9])/"{
            set port $3;
            proxy_pass http://128.0.0.7:$port;
            proxy_header Host $host;
}

I want to access the url /name/(.*)/(.*)/([0-9])/ with this (.*) unique id instead of ([0-9]) port

mtak
  • 16,513
  • 2
  • 52
  • 64
  • If you want to map arbitrary labels to port numbers, use a `map` block. See the [`map` documentation](http://nginx.org/en/docs/http/ngx_http_map_module.html#map). – Richard Smith Dec 09 '22 at 10:37
  • Can I connect to docker containers with my website url using this without mentioning port in the url? – amisha jain Dec 11 '22 at 06:25

0 Answers0