Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

572
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!