Set target URL with headers (for better JS integration), and rewrite `Location` header to use proxy for redirects.