Score:0

pgadmin > nginx > kubernetes (nginx) ingress

cn flag

I have just successfully installed pgadmin app on Kubernetes but I am having troubles with ingress nginx.

I have an internal reversed proxy in front of pgadmin app to host it under a subdirectory. I am simply following documentation to achieve that. The nginx.conf file looks like this:

user nginx;
worker_processes  1;
events {
  worker_connections  10240;
}
http {
  server {
    listen       80;
    server_name  _;

    location /pgadmin4/ {
      proxy_set_header X-Script-Name /pgadmin4;
      proxy_set_header Host $http_host;
      proxy_pass http://pgadmin;
      proxy_redirect off;
    }
  }
}

It works fine, I can access the website with no problem if I directly access the node where the app runs on.

Now I want an ingress rule to have the app accessible on http://mycompanydomain.com/pgadmin4. The ingress server is a kubernetes nginx server which I don't administrate myself. And I would say this is where I am getting troubles with. My ingress rule is as simple as:

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: pgadmin
  namespace: ...
spec:
  rules:
    - http:
        paths:
          - path: /pgadmin4
            pathType: Prefix
            backend:
              serviceName: pgadmin-nginx
              servicePort: 80

Now I am left with a some redirect loop and the page cannot be served:

enter image description here

I have tried a whole combination of settings to no success and spent too much time on it and I am afraid I need a deeper knowledge on nginx.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.