[MSITEMESH-39] Magnolia calls external URL when rendering dynamic area Created: 04/Feb/16  Updated: 19/Apr/16  Resolved: 19/Apr/16

Status: Closed
Project: SiteMesh
Component/s: None
Affects Version/s: 1.0.1
Fix Version/s: None

Type: Improvement Priority: Neutral
Reporter: mikalai smirnou Assignee: Roman Kovařík
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
duplicate
duplicates MSITEMESH-40 The base URL used to retrieve fragmen... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:

 Description   

When magnolia renders page accessed via Multisite domain specified name, dynamic components are also fetched by request issued to domain URL. That makes internal magnolia page rendering mechanism dependent on domain URL which can point to external server e.g. load balancer, which does not seems to be right approach. Further if the multisite page is accessed with mappings/website/ URIPrefix specified, the dynamic component is fetched with domainName but the URIPrefix is not taken into account when build component URL. That makes the url generated for dynamic content requesting load balancer with path which is not supported. Is it a bug or there is a possibility to reconfigure magnolia to fetch dynamic content via localhost?

Example scenario

Multisite settings:

  • Sitename: "casino.com"
  • URIPrefix: "/online-casino/v2"
  • handlePrefix: "/casino-com"
  • domains/casino.com/name: "web-rainbow-six.tipdev.com"

"header" area in "casino-com" node set as dynamic area for caching

When page is requested from a user's browser as follows:

NOTE: GET request is done internally by Magnolia and not by the user's browser, this was checked from logs

Expected behaviour is as follows:

In our case this is a problem because web-rainbow-six.tipdev.com is our loadbalancer and not the server Magnolia is running on



 Comments   
Comment by Roman Kovařík [ 05/Feb/16 ]

Hello,

this complete URL for fragment is created by a mechanism (we provide currently only Sitemesh module out of the box). You can override the method getUrl of InjectUriTag.java and use e.g. ServerConfiguration.getDefaultBaseUrl() as the base instead of the current URL.
Be aware that with this change your site configuration for dynamic components won't be taken into account (e.g. possible custom area configuration in the site app).

Hope that helps
Roman

Comment by mikalai smirnou [ 05/Feb/16 ]

OK but by making such change we wont be able to update magnolia dependencies in the straightforward way. Will you consider adding configuration property which could handle different URLs to fetch dynamic content.

Comment by Roman Kovařík [ 08/Feb/16 ]

Hi,
please create a request via your support account if you have any or also pretty common way is to:

  1. Extend InjectUriTag in your custom module.
  2. Override InjectUriTag class property in the Sitemesh filter configuration from your custom module version handler to use your custom implementation.

You can still update the dependencies in straightforward way.

Regards
Roman

Generated at Mon Feb 12 10:57:12 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.