Issue
I am currently developing a JavaScript (Sencha) app on my Mac which interfaces with an http REST service.
The service is already in place somewhere else (on another domain) and I have no control over it. Since I am developing the app on my own Mac the http requests are currently cross domain and therefore they don't work unless I disable browser security.
A friend of mine who works on a PC said his solution was to set up a reverse proxy using Apache which somehow made the app (who's domain is localhost) think that the service's domain was also localhost. I'm not entirely sure what he meant by that nor do I know how to do that on my Mac. Any suggestions?
Solution
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.)
Answered By - John Chadwick Answer Checked By - Cary Denson (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.