<p>I'm trying to serve an application using NestJS but I'm not being able to do so.</p>
<p>I've already configured Traefik IngressRoutes to serve both Traefik Dashboard and also ArgoCD (and a couple more test apps), but I've been trying to deploy this new application for almost 2 days, without success.</p>
<p>The error is the following:</p>
<pre><code>Bad Gateway
</code></pre>
<p>And this is the log Traefik outputs upon a request:</p>
<pre><code>[traefik-c88c9f869-b8cm8] 10.0.1.122 - - [11/Dec/2020:03:13:20 +0000] &quot;GET /graphql HTTP/2.0&quot; 502 11 &quot;-&quot; &quot;-&quot; 764 &quot;develop-business-app-64fa6977f85a45bb4625@kubernetescrd&quot; &quot;http://10.0.3.86:8080&quot; 1ms
</code></pre>
<p>I don't know if there is any custom configuration I need to do in my app to use HTTP/2.0 or handle Traefik SSL (since the entry point is websecure). I've followed the docs over and over but I always get the same error (I've already tried to remove and installed Traefik again entirely)</p>
<p>Also, if I run <code>kubectl port-forward</code> I can use the application as expected.</p>
<p>Here are my configuration files:</p>
<p>This is my Traefik deployment:</p>
<pre><code>---
kind: Deployment
apiVersion: apps/v1
metadata:
  name: traefik
  labels:
    app.kubernetes.io/name: traefik-proxy
    app.kubernetes.io/version: 1.0.0
    app.kubernetes.io/component: infrastructure
    app.kubernetes.io/part-of: traefik
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: traefik-proxy
  template:
    metadata:
      labels:
        app.kubernetes.io/name: traefik-proxy
        app.kubernetes.io/version: 1.0.0
        app.kubernetes.io/component: infrastructure
        app.kubernetes.io/part-of: traefik
    spec:
      serviceAccountName: traefik-ingress-controller
      volumes:
        - name: acme-certificates
          emptyDir: {}
      containers:
        - name: traefik
          image: traefik:v2.3
          args:
            - --accesslog
            - --providers.kubernetescrd
            - --ping
            - --api.dashboard
            - --entrypoints.traefik.address=:8080
            - --entrypoints.web.address=:80
            - --entrypoints.websecure.address=:443
            - --entrypoints.web.http.redirections.entrypoint.to=websecure
            - --entrypoints.websecure.http.tls.certResolver=letsencrypt
            - --certificatesresolvers.letsencrypt.acme.email=accounts+letsencrypt@getbud.co
            - --certificatesresolvers.letsencrypt.acme.storage=/etc/acme/letsencrypt.json
            - --certificatesResolvers.letsencrypt.acme.dnsChallenge.provider=route53
            - --certificatesResolvers.letsencrypt.acme.dnsChallenge.delayBeforeCheck=0
          volumeMounts:
            - name: acme-certificates
              mountPath: /etc/acme
          ports:
            - containerPort: 8080
              name: admin
              protocol: TCP
            - containerPort: 80
              name: web
              protocol: TCP
            - containerPort: 443
              name: websecure
              protocol: TCP
          livenessProbe:
            failureThreshold: 3
            httpGet:
              path: /ping
              port: 8080
              scheme: HTTP
            initialDelaySeconds: 10
            periodSeconds: 10
            successThreshold: 1
            timeoutSeconds: 2
          readinessProbe:
            failureThreshold: 1
            httpGet:
              path: /ping
              port: 8080
              scheme: HTTP
            initialDelaySeconds: 10
            periodSeconds: 10
            successThreshold: 1
            timeoutSeconds: 2
</code></pre>
<p>This is my application deployment:</p>
<pre><code>---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: business-app
  labels:
    app.kubernetes.io/name: business-app
    app.kubernetes.io/version: 1.0.0
    app.kubernetes.io/component: business
    app.kubernetes.io/part-of: application-layer
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: business-app
  template:
    metadata:
      labels:
        app.kubernetes.io/name: business-app
        app.kubernetes.io/version: 1.0.0
        app.kubernetes.io/component: business
        app.kubernetes.io/part-of: application-layer
    spec:
      containers:
        - name: business-app
          image: 904333181156.dkr.ecr.sa-east-1.amazonaws.com/business:$ECR_TAG &lt;- this is updated with the latest tag using envsubst
          ports:
            - containerPort: 8080
              name: web
              protocol: TCP
</code></pre>
<p>This is my application service:</p>
<pre><code>---
kind: Service
apiVersion: v1
metadata:
  name: business-app
spec:
  selector:
    app.kubernetes.io/name: business-app
  ports:
    - name: web
      port: 80
      targetPort: 8080
</code></pre>
<p>And this is my IngressRoute:</p>
<pre><code>---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: business-app
  labels:
    app.kubernetes.io/name: business-app
    app.kubernetes.io/version: 1.0.0
    app.kubernetes.io/component: business
    app.kubernetes.io/part-of: application-layer
spec:
  entryPoints:
    - websecure
  routes:
    - match: Host(`api.develop.getbud.co`)
      kind: Rule
      services:
        - name: business-app
          port: 80
  tls:
    certResolver: letsencrypt
    options: {}
</code></pre>
<p>Can someone give me a hint on what am I doing wrong?</p>
<p>Just an update, I've changed the loglevel of traefik to debug, and here is what it logs upon request:</p>
<pre><code>[traefik-55888dfd67-r8b2c] time=&quot;2020-12-11T04:54:31Z&quot; level=debug msg=&quot;Error while Peeking first byte: read tcp 10.0.3.86:80-&gt;10.0.1.122:44996: read: connection reset by peer&quot;
[traefik-55888dfd67-r8b2c] time=&quot;2020-12-11T04:54:31Z&quot; level=debug msg=&quot;Error while Peeking first byte: read tcp 10.0.3.86:8080-&gt;10.0.3.100:6380: read: connection reset by peer&quot;
[traefik-55888dfd67-r8b2c] time=&quot;2020-12-11T04:54:32Z&quot; level=debug msg=&quot;vulcand/oxy/roundrobin/rr: begin ServeHttp on request&quot; Request=&quot;{\&quot;Method\&quot;:\&quot;GET\&quot;,\&quot;URL\&quot;:{\&quot;Scheme\&quot;:\&quot;\&quot;,\&quot;Opaque\&quot;:\&quot;\&quot;,\&quot;User\&quot;:null,\&quot;Host\&quot;:\&quot;\&quot;,\&quot;Path\&quot;:\&quot;/graphql\&quot;,\&quot;RawPath\&quot;:\&quot;\&quot;,\&quot;ForceQuery\&quot;:false,\&quot;RawQuery\&quot;:\&quot;\&quot;,\&quot;Fragment\&quot;:\&quot;\&quot;,\&quot;RawFragment\&quot;:\&quot;\&quot;},\&quot;Proto\&quot;:\&quot;HTTP/2.0\&quot;,\&quot;ProtoMajor\&quot;:2,\&quot;ProtoMinor\&quot;:0,\&quot;Header\&quot;:{\&quot;Accept\&quot;:[\&quot;text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\&quot;],\&quot;Accept-Encoding\&quot;:[\&quot;gzip, deflate, br\&quot;],\&quot;Accept-Language\&quot;:[\&quot;en-US,pt-BR;q=0.5\&quot;],\&quot;Cache-Control\&quot;:[\&quot;no-cache\&quot;],\&quot;Pragma\&quot;:[\&quot;no-cache\&quot;],\&quot;Te\&quot;:[\&quot;trailers\&quot;],\&quot;Upgrade-Insecure-Requests\&quot;:[\&quot;1\&quot;],\&quot;User-Agent\&quot;:[\&quot;Mozilla/5.0 (X11; Linux x86_64; rv:83.0) Gecko/20100101 Firefox/83.0\&quot;],\&quot;X-Forwarded-Host\&quot;:[\&quot;api.develop.getbud.co\&quot;],\&quot;X-Forwarded-Port\&quot;:[\&quot;443\&quot;],\&quot;X-Forwarded-Proto\&quot;:[\&quot;https\&quot;],\&quot;X-Forwarded-Server\&quot;:[\&quot;traefik-55888dfd67-r8b2c\&quot;],\&quot;X-Real-Ip\&quot;:[\&quot;10.0.1.122\&quot;]},\&quot;ContentLength\&quot;:0,\&quot;TransferEncoding\&quot;:null,\&quot;Host\&quot;:\&quot;api.develop.getbud.co\&quot;,\&quot;Form\&quot;:null,\&quot;PostForm\&quot;:null,\&quot;MultipartForm\&quot;:null,\&quot;Trailer\&quot;:null,\&quot;RemoteAddr\&quot;:\&quot;10.0.1.122:27473\&quot;,\&quot;RequestURI\&quot;:\&quot;/graphql\&quot;,\&quot;TLS\&quot;:null}&quot;
[traefik-55888dfd67-r8b2c] time=&quot;2020-12-11T04:54:32Z&quot; level=debug msg=&quot;vulcand/oxy/roundrobin/rr: Forwarding this request to URL&quot; Request=&quot;{\&quot;Method\&quot;:\&quot;GET\&quot;,\&quot;URL\&quot;:{\&quot;Scheme\&quot;:\&quot;\&quot;,\&quot;Opaque\&quot;:\&quot;\&quot;,\&quot;User\&quot;:null,\&quot;Host\&quot;:\&quot;\&quot;,\&quot;Path\&quot;:\&quot;/graphql\&quot;,\&quot;RawPath\&quot;:\&quot;\&quot;,\&quot;ForceQuery\&quot;:false,\&quot;RawQuery\&quot;:\&quot;\&quot;,\&quot;Fragment\&quot;:\&quot;\&quot;,\&quot;RawFragment\&quot;:\&quot;\&quot;},\&quot;Proto\&quot;:\&quot;HTTP/2.0\&quot;,\&quot;ProtoMajor\&quot;:2,\&quot;ProtoMinor\&quot;:0,\&quot;Header\&quot;:{\&quot;Accept\&quot;:[\&quot;text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\&quot;],\&quot;Accept-Encoding\&quot;:[\&quot;gzip, deflate, br\&quot;],\&quot;Accept-Language\&quot;:[\&quot;en-US,pt-BR;q=0.5\&quot;],\&quot;Cache-Control\&quot;:[\&quot;no-cache\&quot;],\&quot;Pragma\&quot;:[\&quot;no-cache\&quot;],\&quot;Te\&quot;:[\&quot;trailers\&quot;],\&quot;Upgrade-Insecure-Requests\&quot;:[\&quot;1\&quot;],\&quot;User-Agent\&quot;:[\&quot;Mozilla/5.0 (X11; Linux x86_64; rv:83.0) Gecko/20100101 Firefox/83.0\&quot;],\&quot;X-Forwarded-Host\&quot;:[\&quot;api.develop.getbud.co\&quot;],\&quot;X-Forwarded-Port\&quot;:[\&quot;443\&quot;],\&quot;X-Forwarded-Proto\&quot;:[\&quot;https\&quot;],\&quot;X-Forwarded-Server\&quot;:[\&quot;traefik-55888dfd67-r8b2c\&quot;],\&quot;X-Real-Ip\&quot;:[\&quot;10.0.1.122\&quot;]},\&quot;ContentLength\&quot;:0,\&quot;TransferEncoding\&quot;:null,\&quot;Host\&quot;:\&quot;api.develop.getbud.co\&quot;,\&quot;Form\&quot;:null,\&quot;PostForm\&quot;:null,\&quot;MultipartForm\&quot;:null,\&quot;Trailer\&quot;:null,\&quot;RemoteAddr\&quot;:\&quot;10.0.1.122:27473\&quot;,\&quot;RequestURI\&quot;:\&quot;/graphql\&quot;,\&quot;TLS\&quot;:null}&quot; ForwardURL=&quot;http://10.0.1.158:8080&quot;
[traefik-55888dfd67-r8b2c] time=&quot;2020-12-11T04:54:32Z&quot; level=debug msg=&quot;'502 Bad Gateway' caused by: dial tcp 10.0.1.158:8080: connect: connection refused&quot;
[traefik-55888dfd67-r8b2c] time=&quot;2020-12-11T04:54:32Z&quot; level=debug msg=&quot;vulcand/oxy/roundrobin/rr: completed ServeHttp on request&quot; Request=&quot;{\&quot;Method\&quot;:\&quot;GET\&quot;,\&quot;URL\&quot;:{\&quot;Scheme\&quot;:\&quot;\&quot;,\&quot;Opaque\&quot;:\&quot;\&quot;,\&quot;User\&quot;:null,\&quot;Host\&quot;:\&quot;\&quot;,\&quot;Path\&quot;:\&quot;/graphql\&quot;,\&quot;RawPath\&quot;:\&quot;\&quot;,\&quot;ForceQuery\&quot;:false,\&quot;RawQuery\&quot;:\&quot;\&quot;,\&quot;Fragment\&quot;:\&quot;\&quot;,\&quot;RawFragment\&quot;:\&quot;\&quot;},\&quot;Proto\&quot;:\&quot;HTTP/2.0\&quot;,\&quot;ProtoMajor\&quot;:2,\&quot;ProtoMinor\&quot;:0,\&quot;Header\&quot;:{\&quot;Accept\&quot;:[\&quot;text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\&quot;],\&quot;Accept-Encoding\&quot;:[\&quot;gzip, deflate, br\&quot;],\&quot;Accept-Language\&quot;:[\&quot;en-US,pt-BR;q=0.5\&quot;],\&quot;Cache-Control\&quot;:[\&quot;no-cache\&quot;],\&quot;Pragma\&quot;:[\&quot;no-cache\&quot;],\&quot;Te\&quot;:[\&quot;trailers\&quot;],\&quot;Upgrade-Insecure-Requests\&quot;:[\&quot;1\&quot;],\&quot;User-Agent\&quot;:[\&quot;Mozilla/5.0 (X11; Linux x86_64; rv:83.0) Gecko/20100101 Firefox/83.0\&quot;],\&quot;X-Forwarded-Host\&quot;:[\&quot;api.develop.getbud.co\&quot;],\&quot;X-Forwarded-Port\&quot;:[\&quot;443\&quot;],\&quot;X-Forwarded-Proto\&quot;:[\&quot;https\&quot;],\&quot;X-Forwarded-Server\&quot;:[\&quot;traefik-55888dfd67-r8b2c\&quot;],\&quot;X-Real-Ip\&quot;:[\&quot;10.0.1.122\&quot;]},\&quot;ContentLength\&quot;:0,\&quot;TransferEncoding\&quot;:null,\&quot;Host\&quot;:\&quot;api.develop.getbud.co\&quot;,\&quot;Form\&quot;:null,\&quot;PostForm\&quot;:null,\&quot;MultipartForm\&quot;:null,\&quot;Trailer\&quot;:null,\&quot;RemoteAddr\&quot;:\&quot;10.0.1.122:27473\&quot;,\&quot;RequestURI\&quot;:\&quot;/graphql\&quot;,\&quot;TLS\&quot;:null}&quot;
[traefik-55888dfd67-r8b2c] 10.0.1.122 - - [11/Dec/2020:04:54:32 +0000] &quot;GET /graphql HTTP/2.0&quot; 502 11 &quot;-&quot; &quot;-&quot; 754 &quot;develop-business-app-64fa6977f85a45bb4625@kubernetescrd&quot; &quot;http://10.0.1.158:8080&quot; 2ms
[traefik-55888dfd67-r8b2c] time=&quot;2020-12-11T04:54:32Z&quot; level=debug msg=&quot;Error while Peeking first byte: read tcp 10.0.3.86:443-&gt;10.0.3.75:35314: read: connection reset by peer&quot;
[traefik-55888dfd67-r8b2c] time=&quot;2020-12-11T04:54:32Z&quot; level=debug msg=&quot;vulcand/oxy/roundrobin/rr: begin ServeHttp on request&quot; Request=&quot;{\&quot;Method\&quot;:\&quot;GET\&quot;,\&quot;URL\&quot;:{\&quot;Scheme\&quot;:\&quot;\&quot;,\&quot;Opaque\&quot;:\&quot;\&quot;,\&quot;User\&quot;:null,\&quot;Host\&quot;:\&quot;\&quot;,\&quot;Path\&quot;:\&quot;/favicon.ico\&quot;,\&quot;RawPath\&quot;:\&quot;\&quot;,\&quot;ForceQuery\&quot;:false,\&quot;RawQuery\&quot;:\&quot;\&quot;,\&quot;Fragment\&quot;:\&quot;\&quot;,\&quot;RawFragment\&quot;:\&quot;\&quot;},\&quot;Proto\&quot;:\&quot;HTTP/2.0\&quot;,\&quot;ProtoMajor\&quot;:2,\&quot;ProtoMinor\&quot;:0,\&quot;Header\&quot;:{\&quot;Accept\&quot;:[\&quot;image/webp,*/*\&quot;],\&quot;Accept-Encoding\&quot;:[\&quot;gzip, deflate, br\&quot;],\&quot;Accept-Language\&quot;:[\&quot;en-US,pt-BR;q=0.5\&quot;],\&quot;Cache-Control\&quot;:[\&quot;no-cache\&quot;],\&quot;Pragma\&quot;:[\&quot;no-cache\&quot;],\&quot;Referer\&quot;:[\&quot;https://api.develop.getbud.co/graphql\&quot;],\&quot;Te\&quot;:[\&quot;trailers\&quot;],\&quot;User-Agent\&quot;:[\&quot;Mozilla/5.0 (X11; Linux x86_64; rv:83.0) Gecko/20100101 Firefox/83.0\&quot;],\&quot;X-Forwarded-Host\&quot;:[\&quot;api.develop.getbud.co\&quot;],\&quot;X-Forwarded-Port\&quot;:[\&quot;443\&quot;],\&quot;X-Forwarded-Proto\&quot;:[\&quot;https\&quot;],\&quot;X-Forwarded-Server\&quot;:[\&quot;traefik-55888dfd67-r8b2c\&quot;],\&quot;X-Real-Ip\&quot;:[\&quot;10.0.1.122\&quot;]},\&quot;ContentLength\&quot;:0,\&quot;TransferEncoding\&quot;:null,\&quot;Host\&quot;:\&quot;api.develop.getbud.co\&quot;,\&quot;Form\&quot;:null,\&quot;PostForm\&quot;:null,\&quot;MultipartForm\&quot;:null,\&quot;Trailer\&quot;:null,\&quot;RemoteAddr\&quot;:\&quot;10.0.1.122:27473\&quot;,\&quot;RequestURI\&quot;:\&quot;/favicon.ico\&quot;,\&quot;TLS\&quot;:null}&quot;
[traefik-55888dfd67-r8b2c] time=&quot;2020-12-11T04:54:32Z&quot; level=debug msg=&quot;vulcand/oxy/roundrobin/rr: Forwarding this request to URL&quot; ForwardURL=&quot;http://10.0.1.158:8080&quot; Request=&quot;{\&quot;Method\&quot;:\&quot;GET\&quot;,\&quot;URL\&quot;:{\&quot;Scheme\&quot;:\&quot;\&quot;,\&quot;Opaque\&quot;:\&quot;\&quot;,\&quot;User\&quot;:null,\&quot;Host\&quot;:\&quot;\&quot;,\&quot;Path\&quot;:\&quot;/favicon.ico\&quot;,\&quot;RawPath\&quot;:\&quot;\&quot;,\&quot;ForceQuery\&quot;:false,\&quot;RawQuery\&quot;:\&quot;\&quot;,\&quot;Fragment\&quot;:\&quot;\&quot;,\&quot;RawFragment\&quot;:\&quot;\&quot;},\&quot;Proto\&quot;:\&quot;HTTP/2.0\&quot;,\&quot;ProtoMajor\&quot;:2,\&quot;ProtoMinor\&quot;:0,\&quot;Header\&quot;:{\&quot;Accept\&quot;:[\&quot;image/webp,*/*\&quot;],\&quot;Accept-Encoding\&quot;:[\&quot;gzip, deflate, br\&quot;],\&quot;Accept-Language\&quot;:[\&quot;en-US,pt-BR;q=0.5\&quot;],\&quot;Cache-Control\&quot;:[\&quot;no-cache\&quot;],\&quot;Pragma\&quot;:[\&quot;no-cache\&quot;],\&quot;Referer\&quot;:[\&quot;https://api.develop.getbud.co/graphql\&quot;],\&quot;Te\&quot;:[\&quot;trailers\&quot;],\&quot;User-Agent\&quot;:[\&quot;Mozilla/5.0 (X11; Linux x86_64; rv:83.0) Gecko/20100101 Firefox/83.0\&quot;],\&quot;X-Forwarded-Host\&quot;:[\&quot;api.develop.getbud.co\&quot;],\&quot;X-Forwarded-Port\&quot;:[\&quot;443\&quot;],\&quot;X-Forwarded-Proto\&quot;:[\&quot;https\&quot;],\&quot;X-Forwarded-Server\&quot;:[\&quot;traefik-55888dfd67-r8b2c\&quot;],\&quot;X-Real-Ip\&quot;:[\&quot;10.0.1.122\&quot;]},\&quot;ContentLength\&quot;:0,\&quot;TransferEncoding\&quot;:null,\&quot;Host\&quot;:\&quot;api.develop.getbud.co\&quot;,\&quot;Form\&quot;:null,\&quot;PostForm\&quot;:null,\&quot;MultipartForm\&quot;:null,\&quot;Trailer\&quot;:null,\&quot;RemoteAddr\&quot;:\&quot;10.0.1.122:27473\&quot;,\&quot;RequestURI\&quot;:\&quot;/favicon.ico\&quot;,\&quot;TLS\&quot;:null}&quot;
[traefik-55888dfd67-r8b2c] time=&quot;2020-12-11T04:54:32Z&quot; level=debug msg=&quot;'502 Bad Gateway' caused by: dial tcp 10.0.1.158:8080: connect: connection refused&quot;
[traefik-55888dfd67-r8b2c] time=&quot;2020-12-11T04:54:32Z&quot; level=debug msg=&quot;vulcand/oxy/roundrobin/rr: completed ServeHttp on request&quot; Request=&quot;{\&quot;Method\&quot;:\&quot;GET\&quot;,\&quot;URL\&quot;:{\&quot;Scheme\&quot;:\&quot;\&quot;,\&quot;Opaque\&quot;:\&quot;\&quot;,\&quot;User\&quot;:null,\&quot;Host\&quot;:\&quot;\&quot;,\&quot;Path\&quot;:\&quot;/favicon.ico\&quot;,\&quot;RawPath\&quot;:\&quot;\&quot;,\&quot;ForceQuery\&quot;:false,\&quot;RawQuery\&quot;:\&quot;\&quot;,\&quot;Fragment\&quot;:\&quot;\&quot;,\&quot;RawFragment\&quot;:\&quot;\&quot;},\&quot;Proto\&quot;:\&quot;HTTP/2.0\&quot;,\&quot;ProtoMajor\&quot;:2,\&quot;ProtoMinor\&quot;:0,\&quot;Header\&quot;:{\&quot;Accept\&quot;:[\&quot;image/webp,*/*\&quot;],\&quot;Accept-Encoding\&quot;:[\&quot;gzip, deflate, br\&quot;],\&quot;Accept-Language\&quot;:[\&quot;en-US,pt-BR;q=0.5\&quot;],\&quot;Cache-Control\&quot;:[\&quot;no-cache\&quot;],\&quot;Pragma\&quot;:[\&quot;no-cache\&quot;],\&quot;Referer\&quot;:[\&quot;https://api.develop.getbud.co/graphql\&quot;],\&quot;Te\&quot;:[\&quot;trailers\&quot;],\&quot;User-Agent\&quot;:[\&quot;Mozilla/5.0 (X11; Linux x86_64; rv:83.0) Gecko/20100101 Firefox/83.0\&quot;],\&quot;X-Forwarded-Host\&quot;:[\&quot;api.develop.getbud.co\&quot;],\&quot;X-Forwarded-Port\&quot;:[\&quot;443\&quot;],\&quot;X-Forwarded-Proto\&quot;:[\&quot;https\&quot;],\&quot;X-Forwarded-Server\&quot;:[\&quot;traefik-55888dfd67-r8b2c\&quot;],\&quot;X-Real-Ip\&quot;:[\&quot;10.0.1.122\&quot;]},\&quot;ContentLength\&quot;:0,\&quot;TransferEncoding\&quot;:null,\&quot;Host\&quot;:\&quot;api.develop.getbud.co\&quot;,\&quot;Form\&quot;:null,\&quot;PostForm\&quot;:null,\&quot;MultipartForm\&quot;:null,\&quot;Trailer\&quot;:null,\&quot;RemoteAddr\&quot;:\&quot;10.0.1.122:27473\&quot;,\&quot;RequestURI\&quot;:\&quot;/favicon.ico\&quot;,\&quot;TLS\&quot;:null}&quot;
[traefik-55888dfd67-r8b2c] 10.0.1.122 - - [11/Dec/2020:04:54:32 +0000] &quot;GET /favicon.ico HTTP/2.0&quot; 502 11 &quot;-&quot; &quot;-&quot; 755 &quot;develop-business-app-64fa6977f85a45bb4625@kubernetescrd&quot; &quot;http://10.0.1.158:8080&quot; 1ms
</code></pre>
<p>So, it seems Traefik is receiving a connection refused from the pod. I've opened a shell inside Traefik's container and tried to run wget directly in the Pod IP and indeed I received the same error (connection refused).</p>
<p>Any other working pod whenever I ran wget it works.</p>
<p>Any ideas?</p>

delucca
<p>For those who (like me) are struggling with this issue, here is the problems:</p>
<p>Fastify by default listens only at <code>127.0.0.1</code>, so, it automatically refuses any other host connection. To solve that you can simply add <code>0.0.0.0</code> as the second argument of your <code>app.listen</code> call, like the following:</p>
<p>previous:</p>
<pre><code>  await app.listen(appConfig.port)
</code></pre>
<p>fixed:</p>
<pre><code>  await app.listen(appConfig.port, '0.0.0.0')
</code></pre>
<p>Thanks in any case :)</p>
