Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

573
Vistas
extract CN from client's certificate on nginx-ingress

I'm using kubernetes/ingress-nginx. Task is to extract CN field from client's certificate using nginx ingress. I was searching for a while and found a solution:

   map  $ssl_client_s_dn  $ssl_client_s_dn_cn {
    default "";
    ~CN=(?<CN>[^/,\"]+) $CN;
  }

But I can't adapt this code for nginx ingress.That's what I currently have and it doesn't work.

nginx.ingress.kubernetes.io/http-snippets: |
  map  $ssl_client_s_dn  $ssl_client_s_dn_cn {
    default "";
    ~CN=(?<CN>[^/,\"]+) $CN;
  }
nginx.ingress.kubernetes.io/configuration-snippet: |
  proxy_set_header Remote-User $ssl_client_s_dn_cn;

Probably someone faced with it and know how to adjust this properly, as I'm out of ideas.
If you know more elegant way to do it please share you knowledge here.
Thanks in advance.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I found a solution,hope it may help someone:

    nginx.ingress.kubernetes.io/http-snippet: |
     map  $ssl_client_s_dn  $ssl_client_s_dn_cn {
       default "";
       ~CN=(?<CN>[^/,\"]+) $CN;
     };

    nginx.ingress.kubernetes.io/location-snippet: |
     proxy_set_header REMOTE-USER $ssl_client_s_dn_cn;
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda