Implement IBM HTTP Server reverse proxy to avoid CORS in AngularJS
- 21 Sep, 2016
Working this week on a new WebSphere Portal Project.
Several content are using AngularJS and some calls to get data go to another server in another domain.
To avoid CORS we implement a reverse proxy on the IHS side.
Bellow the config of my httpd.conf. LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_connect_module modules/mod_proxy_connect.so LoadModule proxy_http_module modules/mod_proxy_http.so LoadModule ibm_ssl_module modules/mod_ibm_ssl.so
SSLProxyEngine on KeyFile /opt/IBM/HTTPServer/bin/key.kdb SSLStashfile /opt/IBM/HTTPServer/bin/key.sth
Proxypass /acme/products https://anotherdomain/api/v1/products ProxypassReverse /acme/products https://anotherdomain/api/v1/products