ithewei / libhv

🔥 比libevent/libuv/asio更易用的网络库。A c/c++ network library for developing TCP/UDP/SSL/HTTP/WebSocket/MQTT client/server.

Home Page:https://github.com/ithewei/libhv/wiki

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

does bin/httpd reverse proxy mode follow location

ridams opened this issue · comments

Using bin/httpd -p 8080 with configuration file : /A/ => http://website2/B/
now using
curl -v http://127.0.0.1:8080/A/test I got :

< HTTP/1.1 302 Found
< Server: nginx
< Date: Tue, 09 Apr 2024 01:13:26 GMT
< Content-Type: text/html; charset=UTF-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Location: http://website2/C

I want to be able to get the content directly (/bin/httpd does the follow location and revisit http://website2/C)
can I just configure that in httpd.conf or I have to make change to source code ?

curl support auto location,like this:

curl -L <URL>

Thanks, I know that but the upstream server can leak sensitive data in the location url, I don't want it to be seen by the client or end user

I know what you mean, but the current implementation is to directly forward the data from the backend server without parsing it, so it may not be that simple to implement. You may consider using nginx as a reverse proxy.