<p>I am thinking of setting up multiple chatbots as in a containerized platform lets say docker or Kubernetes, and I would want to be able to access these chatbots through a reverse proxy such as Nginx. any help is appreciated.</p>

<p>My example scenario </p>

<p>I have a multiple chatbots, lets call them  <strong>Bravo, Charlie, Delta</strong> </p>

<ul>
<li>Bravo's IP address and port is 10.0.0.2:8080</li>
<li>Charlie's IP : 10.0.0.3:8080</li>
<li>Delta's IP :10.0.0.4:8080</li>
</ul>

<p>All of these bots are living in containers behind a nginx proxy. 
Now if I want to access these chatbots, I am able to get to the browser with 10.0.0.2:8080  and use the chatbots, </p>

<p>If I could setup a domain  <strong>(alpha,org)</strong> and want to access these chatbots as alpha,com/bravo , or alpha,com/charlie and alpha,com/delta  how would I be able to achieve this.?</p>

<p>The Proxy pass directive works only for the index_html and the chatbot application seems to have some kind of base url path that I am unable to figure out.
nginx returns a blank page if I inspect the traffic. Help me debug this. </p>

Chronograph3r
<p>You can use nginx-ingress controller with this ingress definition: (But first you need to deploy nginx-ingress controller on your cluster, you can use this <a href="https://kubernetes.github.io/ingress-nginx/deploy/" rel="nofollow noreferrer">link</a>)</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: alpha-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - host: alpha.com
    http:
      paths:
      - path: /bravo
        backend:
          serviceName: BravoService
          servicePort: 80
      - path: /charlie
        backend:
          serviceName: CharlieService
          servicePort: 80
      - path: /delta
        backend:
          serviceName: DeltaService
          servicePort: 80 # You could also use named ports if you already named the port in the service like bravo-http-port

</code></pre>

<p>This expects that you have already defined and deployed your services with associated deployments. for Ex:</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: BravoService
  labels:
    app: bravo
spec:
  type: NodePort
  selector:
    app: bravo
  ports:
    - name: bravo-http-port
      protocol: TCP
      port: 80
      targetPort: bravo-port
      nodePort: 8080

---

apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: bravo-deployment
  labels:
    app: bravo
spec:
  # init with 3 replicas
  replicas: 1
  selector:
    matchLabels:
      app: bravo
  template:
    metadata:
      labels:
        app: bravo
    spec:
      containers:
      - name: bravo-container
        image: my-docker-repo/project:1.0
        ports:
        - name: bravo-port
          containerPort: 8080
</code></pre>

<p>If you have more questions on this please don't hesitate.</p>
