How do I set up a reverse proxy on a Mac?

Apache indeed can do reverse proxies, but for your own sake, I'd recommend you don't go with Apache (It's unnecessarily large.)

Though there are many things you can do, what I, personally, would do is install the Nginx webserver and change the configuration to use proxy_pass. It's not terribly hard, but it's especially simple if you are already aware of how to build software from source. A quick google leads to a guide on exactly this - and from there on, you just need to change your ./conf/nginx.conf file to your needs.

Dedicated proxy software is probably a better solution, but you don't need all of the features of a dedicated proxy software, and you certainly don't need all of the features of the Apache web server (or Nginx, really, but Nginx is at least marginally smaller.)


For those seeking a powerful, yet free solution, mitmproxy can act as a reverse proxy. It's a command line tool but with interactive CLI and also offers a web interface. You can directly download it here, it's just a single binary.

To run it as a reverse proxy, just run it with

./mitmproxy --mode "reverse:https://real-destination.example.com"

and then make your client connect to https://localhost:8080. All requests are forwarded to https://real-destination.example.com and TLS is broken up, so you can look into the packets (usually you must install the CA Certificate of mitmproxy on your system and mark it as trusted to make this work).

For those seeking a solution with an interactive UI, a more high level solution that does all system configuration for you, and don't mind spending some money for it, Charles can also act as a reverse proxy and it allows you to configure everything from within the UI application. Charles is also available for iOS on the App Store.