1
을 덮어 씁니다 :프록시 요청 호스트는이 같은 프록시를 제공하기 위해 노력하고 실제 요청
package main
import (
"net/http"
)
func main() {
http.ListenAndServe(":8080", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
println(r.Host)
}))
}
나는 golang.org
가 인쇄 얻을 컬
curl -k -x http://localhost:8080 http://golang.org/
로 호출. 왜 프록시 호스트 이름을 얻지 못합니까? localhost
? HTTP 프록시의 버그 또는 제한 사항입니까?
업데이트
명확히하기 위해, 내가 찾던 Nginx에 서버 주소 같은 것이 http://nginx.org/en/docs/http/ngx_http_core_module.html#var_server_addr