<p>I have a <code>nginx conf</code> like below</p>

<pre><code>map $http_upgrade $connection_upgrade {
  default upgrade;
  ''      close;
}

server {
  listen 80 default_server;
  access_log  off;
  return 200 'Hello, World! - nginx\n';
}

server {
  listen 80;
  server_name ~^(dev-)?(?&lt;app&gt;[^.]+)\.mysite\.com$;
  access_log  off;

  location / {
     resolver 127.0.0.11;
     proxy_set_header Host $host;
     proxy_pass http://${app}-web;
     proxy_set_header Upgrade $http_upgrade;
     proxy_set_header Connection $connection_upgrade;
  }
}

</code></pre>

<p>I expected that redirecting</p>

<p><code>dev-blog.mysite.com</code> into service <code>blog-web</code></p>

<p><code>dev-market.mysite.com</code> into service <code>market-web</code></p>

<p>and so on</p>

<p>Is there any way to implement this in k8s ingress-nginx?</p>

<p>No, you would make a separate Ingress object for each (or one huge one, but that's less common). Usually this is semi-automated through either Helm charts or custom controllers.</p>
