txn2 / n2proxy

Contraband filtering reverse proxy for plain http and SSL.
https://mk.imti.co/golang-reverse-proxy/
Apache License 2.0
32 stars 8 forks source link

handling redirects #2

Open dtenenba opened 4 years ago

dtenenba commented 4 years ago

I am running n2proxy -backend http://localhost:8000 -port 5000

Hitting the / endpoint of that backend redirects (with a 301 or 302) to http://localhost:8000/login. Unfortunately if I go to http://localhost:5000 I end up with http://localhost:8000/login in my browser address bar. What I want is http://localhost:5000/login. Do you know how to fix this?

Seems I need to intercept the Location header and rewrite it.