1. The problem I’m having:
I’m try using caddy for generate new http payload.
I wonder every proxy request must add new payload.
Example standard send payload :
GET / HTTP/1.1
Host: bar.com
User-Agent: curl/7.68.0
Accept: */*
Accept-Encoding: gzip
Then reverse_proxy modify the requests to :
GET / HTTP/1.1
Host: foo.com
GET / HTTP/1.1
Host: bar.com
User-Agent: curl/7.68.0
Accept: */*
Accept-Encoding: gzip
2. Error messages and/or full log output:
2023/10/06 03:12:41.917 ERROR http.log.error net/http: invalid method "GET / HTTP/1.1\\R\\NHOST: FOO.COM\\R\\N\\R\\NGET" {"request": {"remote_ip": "::1", "remote_port": "51396", "client_ip": "::1", "proto": "HTTP/2.0", "method": "GET", "host": "localhost:9002", "uri": "/", "headers": {"User-Agent": ["curl/7.68.0"], "Accept": ["*/*"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "localhost"}}, "duration": 0.000120965, "status": 502, "err_id": "9sr56s1mg", "err_trace": "reverseproxy.statusError (reverseproxy.go:1248)"}
3. Caddy version:
v2.7.4 h1:J8nisjdOxnYHXlorUKXY75Gr6iBfudfoGhrJ8t7/flI=
d. My complete Caddy config:
https://localhost:9002 {
reverse_proxy http://localhost:1337 {
method "GET / HTTP/1.1\r\nHost: foo.com\r\n\r\nGET"
header_up X-Forwarded-Host {host}
}
}