0

I have a pod running moodle and it has NGINX in front of it. The configuration of it is here: https://github.com/google/moodle-on-gcp/blob/main/4-moodle-image-builder/base/etc/nginx/nginx.conf

In my ingress, requests come in under /moodle, however as you can see the backend configuration expects requests to come in at /. So I deployed an NGINX proxy in front of it with the following configuration:

location /moodle/ {
  proxy_pass http://moodle.moodle.svc.cluster.local:80/;
}

essentially I want to strip /moodle from the request and forward it to the backend. With this configuration however I see ERR_TOO_MANY_REDIRECTS.

I tried several different configurations but I cannot get this to work

Foobar
  • 101

1 Answers1

0

You may want to check this solution on redirecting the proxy_pass to localhost.

location / {
  proxy_pass http://localhost:80;
}

Since the moodle ingress uses pathType: ImplementationSpecific you may modify this to a proper service wherein your backend is located.

spec:
  ingressClassName: "nginx"
  rules:
  - host: moodle.<YOUR-LB-EXTERNAL-IP>.nip.io
    http:
      paths:
        - path: /
          pathType: ImplementationSpecific
          backend:
            service:
              name: moodle
              port:
                number: 80
x-zone-cat
  • 169
  • 1