apiVersion: v1
kind: ConfigMap
metadata:
  name: nginx-conf
data:
  nginx.conf: |
    upstream team-blue {
      server team-blue:3001;
    }

    upstream team-green {
      server team-green:3002;
    }

    upstream team-red {
      server team-red:3003;
    }

    log_format compact '$request $status - $bytes_sent';
    access_log off;

    server {
      listen 3000;

      access_log /var/log/nginx/access.log compact;
      ssi on;

      location /blue {
        proxy_pass  http://team-blue;
      }

      location /green {
        proxy_pass  http://team-green;
      }

      location /red {
        proxy_pass  http://team-red;
      }

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

      location / {
        proxy_pass  http://team-red;
      }
    }
