Tuesday, April 22, 2014

Configuring MOD_Proxy in Apache (Linux)

To solve the cross-origen integration problem in Apache Server, then we need the following configuration settings in httpd.conf file.

ProxyRequests Off
ProxyPreserveHost Off

If any request URL containts "/rest" sub-string then it will be replaced with http://15.0.0.1:8888/ and it will forwards the control to that http://15.0.0.1:8888/

ProxyPass http://15.0.0.1:8888/
ProxyPassReverse http://15.0.0.1:8888/

If any request URL containts "/tokens" sub-string then it will be replaced with http://15.0.0.1:9999/v2.0/tokens and it will forwards the control to that http://15.0.0.1:9999/v2.0/tokens


ProxyPass http://15.0.0.1:9999/v2.0/tokens
ProxyPassReverse http://15.0.0.1:9999/v2.0/tokens