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

2
  • Have you checked which redirects is that? Try running curl -IL <link> in CLI where you'll see locations to which it's redirecting you. Commented Mar 13, 2024 at 15:40
  • In general when you connect to the default port in an URL the port number must be omitted. 80 is the default port for clear text HTTP and http://<host>:80/ should be http://<host>/ Commented Mar 19, 2024 at 15:21

1 Answer 1

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 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.