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

629
Views
Kubectl proxy behind NGINX: invalid upgrade response

I'm trying to add a local Kubernates cluster to my GitLab group for CI/CD deployments. I've started with running the following command:

kubectl proxy --address 0.0.0.0 --accept-hosts '.*'

I've tested it executing curl http://localhost:8001/api and running curl http://192.168.1.2:8001/api from another machine in the same network. Proxy was available in my local network.

The next step was to make the proxy available on the internet behind kubernates.example.com. For that I've configured NGINX as the following:

server {
    server_name kubernates.example.com;
    listen 443 ssl;
    listen 80;

    include ssl_standart_conf;

    location / {
        proxy_pass http://192.168.1.2:8001/;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_redirect off;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}

Executing curl https://kubernates.example.com/api returned the following error:

invalid upgrade response: status code 200

Kubernates proxy logs

E0225 22:33:50.944018 1642369 upgradeaware.go:312] Proxy upgrade error: invalid upgrade response: status code 200
E0225 22:33:50.944060 1642369 proxy_server.go:144] Error while proxying request: invalid upgrade response: status code 200
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Okay, I've managed to resolve the issue. The following nginx configuration made a trick

server {
    server_name kubernates.example.com;
    listen 443 ssl;
    listen 80;

    include ssl_standart_conf;

    location / {
        proxy_pass http://192.168.1.2:8001/;
        proxy_set_header Host $host;
    }
}
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!