Quantcast
Channel: Active questions tagged https - Stack Overflow
Viewing all articles
Browse latest Browse all 1516

How to add Custom header in https request with nginx proxy? Getting HTTP error code 400 from proxy

$
0
0

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


Viewing all articles
Browse latest Browse all 1516

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>