2

I have a web application that communicates to a web service deployed on the same server. The web app was written with Tibco General Interface and works well only when it is running locally on the development system. When I deploy the web app to the Apache server it fails with code 200 apparently due to cross domain data. I use Firefox as a browser. I have tried changing Internet Explorer to access cross domain data and it works however IE is not an option.

Web application runs on 192.168.2.205 (port 80).
Web service runs on 192.168.2.205:8040

I have tried a number of things with proxypass inside Apache with no luck.

3

1 Answer 1

2

Here is an apache virtual host configuration that should work for you to reverse proxy your web app through Apache. Replace mydomain.example.com with your actual domain name. You will need to have mod_poxy and mod_proxy_http loaded by apache and if you use ProxyHTML directives, you will need mod_proxy_html as well.

<VirtualHost *:80>

    ServerName mydomain.example.com

    # Enable a reverse proxy to your web app
    ProxyRequests Off        
    ProxyPass / http://192.168.2.205:8040/

    # If your web app is setting cookies for the wrong domain name.
    # This fixes when they are set for 'localhost'.
    # If your web application is setting cookies correctly,
    # leave this section out
    ProxyPassReverseCookieDomain localhost mydomain.example.com

    # If your web app is writing links incorrectly.
    # If the web app sets all the URLs correctly,
    # leave this section out
    ProxyHTMLEnable On
    ProxyHTMLURLMap http://localhost/ http://mydomain.example.com/
    ProxyHTMLURLMap http://192.168.2.205/ http://mydomain.example.com/
    ProxyHTMLURLMap http://192.168.2.205:8040/ http://mydomain.example.com/

</VirtualHost>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.