2
votes

I have an ingress that is configured like such:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: connect-app
  namespace: default
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
    nginx.ingress.kubernetes.io/ssl-redirect: "false"
spec:
  rules:
  - host: it.tufts.edu
    http:
      paths:
      - path: "/"
        backend:
          serviceName: connect-it
          servicePort: 80

and the nginx controller has a configmap that looks like this:

apiVersion: v1
items:
- apiVersion: v1
  data:
    ssl-redirect: "false"
  kind: ConfigMap
  metadata:
    annotations:
      kubectl.kubernetes.io/last-applied-configuration: |
        {"apiVersion":"v1","data":null,"kind":"ConfigMap","metadata":{"annotations":{},"name":"nginx-config","namespace":"nginx-ingress"}}
    creationTimestamp: 2018-11-13T20:56:49Z
    name: nginx-config
    namespace: nginx-ingress
    resourceVersion: "3633400"
    selfLink: /api/v1/namespaces/nginx-ingress/configmaps/nginx-config
    uid: a3ec70bc-e786-11e8-be24-005056a401f6
kind: List
metadata:
  resourceVersion: ""
  selfLink: ""

According to the documentation, this should disable the redirect from http to https but it doesn't seem to workout, what am I doing wrong?

Thanks

1
Can you post the nginx.conf from inside of your pod? - Crou
Hi, @Crou Sorry you mean the pod that is part of the service or the nginx-ingress pod? The pod that is part of the service I'm trying to not have TLS on is an apache webserver: <VirtualHost *:80> DocumentRoot "/directory" ServerName it.tufts.edu DirectoryIndex index.html .index.html index.shtml index.pl index.cgi index.htm .index.htm <Directory "//directoryl"> Options Indexes FollowSymLinks AllowOverride Indexes Options=Indexes FileInfo </Directory> </VirtualHost> ~ - sgarre02
Try adding annotation kubernetes.io/ingress.class: "nginx" to the nginx-ingress yaml - Crou
Yeah, that didn't work. when I have 443 in the nginx-ingress yaml it works fine, as soon as I take it out it breaks. There has to be another place that its getting set that either isn't documented well or I"m just overlooking. - sgarre02

1 Answers

1
votes

I believe this is either:

  • A problem with your nginx ingress controller not updating the configs which you can check with:

    $ kubectl cp <nginx-ingress-controller-pod>:nginx.conf .
    $ cat nginx.conf
    
  • A problem with your apache config redirecting to HTTPS from HTTP (port 80)