Skip to content

Pihole, ingress and subpath, how?! #253

Answered by i5Js
i5Js asked this question in Q&A
Feb 16, 2023 · 4 comments · 14 replies
Discussion options

You must be logged in to vote

The way to go

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: pihole
  namespace: dns-home
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$2
    nginx.ingress.kubernetes.io/proxy-buffer-size: "16k"
    nginx.ingress.kubernetes.io/proxy-no-cache: "1"
    nginx.ingress.kubernetes.io/proxy-set-header: Authorization $http_authorization;
    nginx.ingress.kubernetes.io/configuration-snippet: |
      if ($request_uri ~ ^/pihole/?$) {
        return 301 /pihole/admin/;
      }
      if ($request_uri ~ ^/admin/?$) {
        return 301 /pihole/admin/;
      }
  labels:
    app: pihole
spec:
  ingressClassName: nginx
  rules:
  - host: myhome.k3s.local
    http:
  …

Replies: 4 comments 14 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@dwarf-king-hreidmar
Comment options

@dwarf-king-hreidmar
Comment options

@dwarf-king-hreidmar
Comment options

Comment options

You must be logged in to vote
11 replies
@i5Js
Comment options

@dwarf-king-hreidmar
Comment options

@i5Js
Comment options

@dwarf-king-hreidmar
Comment options

@i5Js
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by i5Js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants