libhv icon indicating copy to clipboard operation
libhv copied to clipboard

does bin/httpd reverse proxy mode follow location

Open ridams opened this issue 1 year ago • 3 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 ?

ridams avatar Apr 09 '24 01:04 ridams

curl support auto location,like this:

curl -L <URL>

ithewei avatar Apr 09 '24 04:04 ithewei

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

ridams avatar Apr 09 '24 22:04 ridams

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.

ithewei avatar Apr 10 '24 03:04 ithewei