Add Custom header in https request with nginx proxy.
I am trying to use nginx as man in the middle proxy with ssl termination and add headers and send it to the same request host with updated headers
export https_proxy=http://localhost:8080curl -v https://google.com
server { listen 8080 ssl; server_name localhost; ssl_certificate /etc/nginx/mitm/nginx-mitm-proxy.crt; ssl_certificate_key /etc/nginx/mitm/nginx-mitm-proxy.key; location / { proxy_pass https://$host$request_uri; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Custom-header "";}
I am getting this error. curl: (56) Received HTTP code 400 from proxy after CONNECT