Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with ssl-redirect="false" #120

Closed
kmathmann opened this issue Mar 16, 2018 · 2 comments
Closed

Problem with ssl-redirect="false" #120

kmathmann opened this issue Mar 16, 2018 · 2 comments
Labels
Milestone

Comments

@kmathmann
Copy link

If i request my node on port 80 with a host that is not specified in any ingress config i get the result code 302 "Found" with the same location as i requested but instead of http it uses https.

I understood ssl-redirect="false" like it should disable this behavior. But the strange thing is that when i use a host in a ingress that then the behavior is gone for that host.

If i request http://foo.bar/ or http://bar.foo/ i get a response from the ingress-default-backend (google_containers defaultbackend).
But when i request http://example.com i get the 302 page again.

Did i miss something? I only want to get the defaultbackend's 404 response in that cases too.

I use the canary tag.

Request

curl --request GET \
  --url http://SERVER_IP/ \
  --header 'Cache-Control: no-cache' \
  --header 'Host: example.com'

ConfigMap

apiVersion: v1
kind: ConfigMap
metadata:
  name: haproxy-ingress
  namespace: ingress-controller
data:
    dynamic-scaling: "true"
    backend-server-slots-increment: "4"
    ssl-redirect: "false"

Ingress

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: app-ingress
  namespace: ingress-controller
  annotations:
    ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - host: bar.foo
    http:
      paths:
      - path: /app
        backend:
          serviceName: http-svc
          servicePort: 8080
  - host: foo.bar
    http:
      paths:
      - path: /app
        backend:
          serviceName: http-svc
          servicePort: 8080
      - path: /nodejs
        backend:
          serviceName: nodejs
          servicePort: 8080

haproxy-deamonSet

apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
  labels:
    run: haproxy-ingress
  name: haproxy-ingress
  namespace: ingress-controller
spec:
  ....
  template: 
    ...
    spec:
      ...
      containers:
      - name: haproxy-ingress
        image: quay.io/jcmoraisjr/haproxy-ingress:canary
        args:
        - --default-backend-service=$(POD_NAMESPACE)/ingress-default-backend
        - --reload-strategy=multibinder
        - --configmap=$(POD_NAMESPACE)/haproxy-ingress
        - --sort-backends
  ...
@jcmoraisjr
Copy link
Owner

Thanks for reporting! Please verify if the new canary tag solved this issue.

@kmathmann
Copy link
Author

Yeah fantastic, the new canary tag solved it. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants