Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-104208

Liferay unable to load Javascript resources when using a CDN or when using a custom context with a portal proxy path

    Details

      Description

      In certain configurations (CDN, or proxy path + custom context, or CDN + proxy path + custom context), Javascript resources fail to load.

      Steps to reproduce 1

      1. Setup a bundle to point to itself as the CDN
        cdn.host.http=http://localhost:8080
        
      2. Start Liferay
      3. Open the browser console, switch to the Network tab
      4. Navigate to http://localhost:8080/?js_fast_load=1

      Expected behavior is that there are no URLs with an error. Actual behavior is that many combo URLs have an error.

      Steps to reproduce 2

      1. Rename the Liferay context to "liferay" (rename webapps/ROOT to webapps/liferay, rename conf/Catalina/localhost/ROOT.xml to conf/Catalina/localhost/liferay.xml)
      2. Setup an Apache reverse proxy that routes the path "/proxy" to "ajp://127.0.0.1:8009" and rewrites the cookie paths (so that login works correctly)
        NameVirtualHost On
        
        <Proxy "balancer://localhost">
            BalancerMember "ajp://127.0.0.1:8009"
        </Proxy>
        
        <VirtualHost *:80>
            ProxyPreserveHost On
            ProxyPass        "/proxy" "balancer://localhost" stickysession=JSESSIONID
            ProxyPassReverse "/proxy" "balancer://localhost" stickysession=JSESSIONID
            ProxyPassReverseCookiePath "/liferay" "/proxy/liferay"
            ProxyPassReverseCookiePath "/" "/proxy/"
        </VirtualHost>
        
      3. Update portal-ext.properties so that Liferay knows that we have a portal proxy path.
        portal.proxy.path=/proxy
        
      4. Start Liferay
      5. Open the browser console, switch to the Network tab
      6. Navigate to http://localhost/proxy/liferay/web/guest/home?js_fast_load=0
      7. Navigate to http://localhost/proxy/liferay/web/guest/home?js_fast_load=1

      Expected behavior is that there are no URLs with an error. Actual behavior is that many regular URLs have errors when js_fast_load=0 and many combo URLs have an error when js_fast_load=1.

      Steps to reproduce 3

      1. Follow all the setup steps from "Steps to reproduce 2"
      2. Also setup the bundle to point to itself as the CDN
        cdn.host.http=http://localhost
        
      3. Start Liferay
      4. Open the browser console, switch to the Network tab
      5. Navigate to http://localhost/proxy/liferay/web/guest/home?js_fast_load=0
      6. Navigate to http://localhost/proxy/liferay/web/guest/home?js_fast_load=1

      Expected behavior is that there are no URLs with an error. Actual behavior is that many regular URLs have errors when js_fast_load=0 and many combo URLs have an error when js_fast_load=1.

        Attachments

          Activity

            People

            Assignee:
            summer.zhang Summer Zhang
            Reporter:
            minhchau.dang Minhchau Dang
            Participants of an Issue:
            Recent user:
            Jason Pince
            Engineering Assignee:
            Minhchau Dang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              1 year, 1 week ago

                Packages

                Version Package
                7.2.10 DXP FP4
                7.2.X
                7.3.0 CE GA1
                7.3.10 DXP GA1
                Master