Closed LuoHaibin closed 4 years ago
server { listen 80; location / { proxy_pass http://192.168.0.103:81; more_set_input_headers 'Host: foo'; more_set_input_headers 'o-Host: foo'; } }
$ curl -svo /dev/null http://127.0.0.1 * Trying 127.0.0.1:80... * TCP_NODELAY set * Connected to 127.0.0.1 (127.0.0.1) port 80 (#0) > GET / HTTP/1.1 > Host: 127.0.0.1 > User-Agent: curl/7.68.0 > Accept: */* > * Mark bundle as not supporting multiuse < HTTP/1.1 200 OK < Server: nginx/1.18.0 < Date: Sun, 19 Jul 2020 06:39:30 GMT < Content-Type: text/html < Content-Length: 612 < Connection: keep-alive < Last-Modified: Tue, 21 Jan 2020 13:39:42 GMT < ETag: "5e26ff1e-264" < Accept-Ranges: bytes < { [612 bytes data] * Connection #0 to host 127.0.0.1 left intact
GET / HTTP/1.0 Host: 192.168.0.103:81 Connection: close User-Agent: curl/7.68.0 Accept: */* o-Host: foo
more_set_input_headers 'o-Host: foo'; worked, but more_set_input_headers 'Host: foo'; didn't
more_set_input_headers 'o-Host: foo';
more_set_input_headers 'Host: foo';
I'm running into the exact same issue. Even the example for setting Host from the Readme doesn't seem to be working. How did you solve this in the end?
Build:
Config:
Request:
Proxied Server:
more_set_input_headers 'o-Host: foo';
worked, butmore_set_input_headers 'Host: foo';
didn't