Jump to content
  • Connecting to LiveView through an Apache Proxy Server


    Issue

    The Live Datamart javascript implementation requires several apache proxy and reverse-proxy settings to function correctly when using apache as a proxy server.

    Solution

    LiveView javascript requires these modules to be enabled in apache's httpd.conf:

    • LoadModule proxy_module modules/mod_proxy.so
    • LoadModule proxy_http_module modules/mod_proxy_http.so
    • LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so

    The proxy_wstunnel_module requires apache version 2.4. Older versions of apache do not include this module.

    Use this working configuration as an example to proxy the sample_lv-javascript project's "simple" sample:

    Code Snippet

    liveview_javascript.conf
    
    # Reverse Proxy Config
    ProxyRequests Off
    ProxyPreserveHost On
    
    <Proxy *>
      Order deny,allow
      Allow from all
    </Proxy>
    
    # Project Specific Redirects (Example)
    <Location /simple >
      ProxyPass http://localhost:10080/simple
      ProxyPassReverse http://localhost:10080/simple
    </Location>
    
    # Platform Specific Redirects (Change "localhost" to the hostname of your LiveView server)
    
    <Location /lv/client/ >
      ProxyPass http://localhost:10080/lv/client/
      ProxyPassReverse http://localhost:10080/lv/client/
    </Location> 
    
    <Location /lv/api/ >
      ProxyPass http://localhost:10080/lv/api/
      ProxyPassReverse http://localhost:10080/lv/api/
    </Location>
    
    <Location /lv/streaming/ >
      ProxyPass ws://localhost:10080/lv/streaming/
      ProxyPassReverse ws://localhost:10080/lv/streaming/
    </Location>
     

    Your project may depend upon additional LiveView platform resources in addition to those required by the "simple" sample. You will need to troubleshoot your project to add these additional Location entries as needed.

    To troubleshoot your configuration after any failure examine the most recent entries in apache/logs/access.log and enable the console view in your web browser (and make sure javascript messages are not hidden). The typical error will be "404" indicating that the proxy configuration generated an invalid URL for the location request. Inspect the URL and determine whether to add a new Location entry to the proxy configuration, or correct a ProxyPass setting in an existing Location-entry.


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...