Nginx 404 on k8s cluster

Description

I have several rocket chat deployments made via the helm stable/rocketchat chart. To get each individual deployment out to a customer, I want to have the following naming convention: chat.url.com/{customerServer}. When I try to go to http://{elbId}.elb.{awsRegion}.amazonaws.com/18 and I look at the Network tab when inspecting with Chrome, I see the following Request URLs for the errors I get:

http://{elbId}.elb.{awsRegion}.amazonaws.com/0d56f40e943e54c255e4c24f76515cfd7f96b0ba.css?meteor_css_resource=true
http://{elbId}.elb.{awsRegion}.amazonaws.com/theme.css?a3b4fcb68119628f5917e597791afaf016f89ce9
http://{elbId}.elb.{awsRegion}.amazonaws.com/theme.css?a3b4fcb68119628f5917e597791afaf016f89ce9
http://{elbId}.elb.{awsRegion}.amazonaws.com/ac11d863a25a3996b976770452c483c5bf201959.js?meteor_js_resource=true

Note that the /18 part of the route is missing from the request URL. Am I creating the Nginx ingress incorrectly? Should I pass a template to the helm chart? This wasn’t working when I wasn’t passing the HTTP_FORWARDED_COUNT argument either.

Server Setup Information

  • Version of Rocket.Chat Server: 2.4.9
  • Operating System: Debian GNU/Linux 9 (stretch)
  • Deployment Method: Helm/Kubernetes
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • NodeJS Version: v8.17.0
  • MongoDB Version: 4.2.3
  • Proxy: Nginx (installed via the helm chart stable/nginx-ingress)
  • Firewalls involved: N/A

Additional setup information

  • Cloud provider: AWS
  • Kubernetes version: 1.14

Any additional Information

The values I’m passing to stable/rocketchat.

serviceAccount:
  name: fc18

extraEnv: |
  - name: ROOT_URL
    value: http://{elbId}.elb.{awsRegion}.amazonaws.com
  - name: HTTP_FORWARDED_COUNT
    value: "1"

service:
  port: 80
  type: NodePort
#   nodePort: 30000

ingress:
  enabled: true
  annotations: {
    # nginx.ingress.kubernetes.io/ssl-redirect: "false",
    # nginx.ingress.kubernetes.io/force-ssl-redirect: "false",
    kubernetes.io/ingress.class: "nginx",
    nginx.ingress.kubernetes.io/rewrite-target: /
  }
  path: /18

mongodb:
  enabled: true
  mongodbUsername: fc18
  mongodbDatabase: fc18
  mongodbPassword: fc18
  mongodbRootPassword: fc18

  persistence:
    enabled: true
    existingClaim: true
    mountPath: /bitnami/mongodb/fc18

persistence:
  enabled: false

Refer to the following values for the nginx ingress I’m creating.