How to set up reverse proxy on Mac?

I am currently developing an application in Sencha (Javascript) on my Mac that interacts with the underlying REST service through HTTP requests. The service is already located somewhere else (in a different domain), and I do not control it. Since I am developing the application on my own Mac, HTTP requests are currently cross-domains, so they do not work unless I turn off browser protection. My friend, who works on a PC, said his solution was to set up a reverse proxy using Apache, which somehow made the application in development (who is the localhost domain), assuming the service domain was also localhost. I'm not quite sure what he meant, and I don't know how to do this on my Mac. Any suggestions?

+4
source share
1 answer

Apache can actually do reverse proxies, but for your own sake, I would recommend you not to go with Apache (it's too big.)

Although there are many things that you can do, what I personally will do is install the Nginx web server and change the configuration to use proxy_pass.This is not very difficult, but it is especially simple if you already know how to create software from the source. . A quick google leads to a guide on this - and from there you just need to change your ./conf/nginx.conf file to your needs.

Dedicated proxy software is probably the best solution, but you do not need all the features of specialized proxy software, and you certainly do not need all the functions of the Apache web server (or Nginx, but Nginx is at least slightly less.)

+3
source

Source: https://habr.com/ru/post/1381497/


All Articles