#how to change path on reverse proxy?

2 messages · Page 1 of 1 (latest)

gilded acorn
#

I have created an endpoint /user/login and able to do the reverse proxy using this code 👇

proxy := httputil.NewSingleHostReverseProxy(target)
proxy.ServeHTTP(w, r)

But if the target has a different path than /user/login I'm not able to connect.
eventually, my goal is to achieve this 👉 ( receive /user/<anything> on the gateway and proxy it to the user service at / )

in the user service, I am running an HTTP server with the routing too.
Any solution?

#

how to change path on reverse proxy?