title: Create an nginx reverse proxy container to forward to specific URL/Port based on requested URL
body: <p>I want to setup an nginx reverse proxy docker container which forwards based on the URL requested. I have setup dns pointing from all these subdomains of domain.com to the nginx server container.</p>
  
  <p>Example scenario:</p>
  
  <p>Request: subdomain1.domain.com
  should forward to abc.xyz.com:8087</p>
  
  <p>Request: subdomain2.domain.com
  should forward to abc.xyz.com:8088</p>
  
  <p>I need to know what I should write in the dockerfile and the nginx.conf file to make the above forward happen. Also these forwards will grow in the future, would there be a way to add these programmatically?</p>