Set ssl_certificate path in conf.d in Nginx ingress controller

9/27/2018

I need to set in Nginx ingress controller the conf.d file. The fields that I need to change is ssl_certificate and ssl_certificate_key.

I will be happy for yaml example.

-- Oron Golan
kubernetes
nginx-ingress

1 Answer

9/27/2018

You can set these fields with configuration parameters of Nginx ingress controller.

There is a nginx ingress controller argument to do this:

--default-ssl-certificate: namespace/tls-secret

This sets a default certificate in case the ingress resource doesn't specify one.

Also you can set a tls secret per ingress resource:

spec:
  tls:
  - hosts:
    - my.host.com
    secretName: tls-secret

Both those solutions sets ssl_certificate and ssl_certificate_key in the nginx config

-- Ignacio Millán
Source: StackOverflow