Nginx, in proxy mode, even has a nice sub_filter where you can rewrite the response body. Pick a tag that generally occurs once, like </head>, and replace it with arbitary text. Like maybe "</head><script src="whatever"></script>".
That would be perfect...no need to recreate the target site's look and feel. Just whatever js you need to scrape the credentials.