got this idea watching Mr. Robot TV series pilot movie, there is spoken about:

"using the onion routing protocol to keep the servers anonymous."

how is it possible to setup the webserver so it forward requests into the Tor network which will obtain data from the Tor hidden service (something.onion) and send back to the front end server with Tor installed and this server will send reply to the client via normal Internet?

Thank You


Interesting tutorials:

Reverse proxying Tor hidden services - https://warrenguy.me/blog/reverse-proxying-tor-hidden-services
Reverse transparent protocol agnostic socks proxy. - https://github.com/jtripper/reverse-proxy/blob/master/config.py


Similar question: https://stackoverflow.com/questions/35009271/nginx-squid-privoxy-tor-to-reverse-proxy-and-protect-connecting-ips