[opencms-dev] Technical inquiry: Multi-server site routing under shared domain in OpenCms
Lorenz Lammersdorf
l.lammersdorf at ik.me
Fri Sep 12 09:11:09 CEST 2025
Hi Ramon,
how's your mod_proxy / mod_rewrite configured? Apache is for sure not
the world's best proxy / load balancer :)
> We're seeing problems with internal links, AJAX calls, and static
exports not resolving correctly
that means, the proxy sends a 301/302 for ajax calls?
static exports can (and should) be served by the proxy itself. Or is
your problem that the redirect mixes up site1 and site2?
Regards
Lorenz
Am 12.09.2025 um 08:35 schrieb Ramon Gavira Sáenz:
> Hi Lorenz,
> Thanks for your reply!
> You're right — mod_proxy_balancer and session stickiness are useful, but
> our main issue isn't load balancing or caching. It's more about URL
> rewriting and redirection across multiple OpenCms servers under a shared
> domain.
> We're seeing problems with internal links, AJAX calls, and static
> exports not resolving correctly, likely due to how Apache handles path-
> based routing.
> Any tips or examples on managing complex rewrite setups would be very
> helpful.
> Best regards,
> Ramon G.
>
> ------------------------------------------------------------------------
> *De:* opencms-dev <opencms-dev-bounces at opencms.org> en nombre de Lorenz
> Lammersdorf via opencms-dev <opencms-dev at opencms.org>
> *Enviado:* jueves, 11 de septiembre de 2025 19:01
> *Para:* opencms-dev at opencms.org <opencms-dev at opencms.org>
> *Cc:* Lorenz Lammersdorf <l.lammersdorf at ik.me>
> *Asunto:* Re: [opencms-dev] Technical inquiry: Multi-server site routing
> under shared domain in OpenCms
> Hi Ramon,
>
> I assume you're using mod_proxy? It supports session stickyness.
>
> Usually caching is done on the proxy. mod_proxy doesn't support caching,
> have a look into mod_cache.
>
> You should probably use a load balancer instead of a reverse proxy (and
> I assume load balancing is the reason for this setup anyway).
> mod_proxy_balancer is maybe your friend.
>
> Regards
> Lorenz
>
>
> Am 11.09.2025 um 18:38 schrieb Ramon Gavira Sáenz via opencms-dev:
>> Hello,
>> I'm currently working on setting up an OpenCms architecture where
>> multiple sites, hosted on separate OpenCms servers, are accessible under
>> a shared corporate domain using path-based routing. The intended
>> structure is as follows:
>>
>> * |https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.corporate-domain.com%2Fopencms-server1%2Fsite1%257C&data=05%7C02%7Cramon.gavira%40sagasoluciones.com%7Cf27862f8686840fbb36908ddf154dd68%7Cf6b0987d77bc48e294799ca6dc648a37%7C0%7C0%7C638932069137174949%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C60000%7C%7C%7C&sdata=oI27Ru5roE1Wmmq8plkUOZPds8l0CfiuQGuSYi4bJqs%3D&reserved=0 → served
>> by /site1/ on *OpenCms Server 1*
>> * |https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.corporate-domain.com%2Fopencms-server1%2Fsite2%257C&data=05%7C02%7Cramon.gavira%40sagasoluciones.com%7Cf27862f8686840fbb36908ddf154dd68%7Cf6b0987d77bc48e294799ca6dc648a37%7C0%7C0%7C638932069137204386%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C60000%7C%7C%7C&sdata=AYHCxNIYKwIsLkdGscPop9Sfg1spjTPr%2B60d91tkKLc%3D&reserved=0 → served
>> by /site2/ on *OpenCms Server 1*
>> * |https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.corporate-domain.com%2Fopencms-server2%2Fsite1%257C&data=05%7C02%7Cramon.gavira%40sagasoluciones.com%7Cf27862f8686840fbb36908ddf154dd68%7Cf6b0987d77bc48e294799ca6dc648a37%7C0%7C0%7C638932069137222704%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C60000%7C%7C%7C&sdata=HJjRte4L0MoIgJrwK73NmGz0lWo7GpA1d9J9%2BkR8ARs%3D&reserved=0 → served
>> by /site1/ on *OpenCms Server 2*
>> * |https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.corporate-domain.com%2Fopencms-server2%2Fsite2%257C&data=05%7C02%7Cramon.gavira%40sagasoluciones.com%7Cf27862f8686840fbb36908ddf154dd68%7Cf6b0987d77bc48e294799ca6dc648a37%7C0%7C0%7C638932069137240316%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C60000%7C%7C%7C&sdata=wfns8szE5RGWYCkacxSLbf6xjeJwfzqnCk9DgUdZ5%2BI%3D&reserved=0 → served
>> by /site2/ on *OpenCms Server 2*
>>
>> To achieve this, I'm using *Apache HTTP Server* as a reverse proxy to
>> route requests based on URL path to the appropriate backend OpenCms
>> instance. However, I'm facing several issues that prevent the setup from
>> working reliably:
>>
>> * *Static export problems*: Some resources are not being served
>> correctly depending on the site and server.
>> * *AJAX calls*: Requests sometimes fail or are misrouted, especially
>> when dealing with dynamic content or session-dependent data.
>> * *Other inconsistencies*: Occasionally, internal links, resource
>> paths, or redirects behave unexpectedly, breaking the user experience.
>>
>> I'm wondering:
>>
>> * Has anyone successfully implemented a similar architecture with OpenCms?
>> * Are there best practices or recommended configurations for Apache
>> (or alternatives like NGINX) to handle this kind of routing?
>> * Are there known limitations in OpenCms when operating behind a
>> reverse proxy with multiple instances?
>> * How do you handle session management, caching, and resource linking
>> across sites in this scenario?
>>
>> Any technical insights, configuration examples, or documentation
>> references would be greatly appreciated.
>> Thanks in advance!
>> Ramon G.
>>
>>
>> _______________________________________________
>> This mail is sent to you from the opencms-dev mailing list
>> To change your list options, or to unsubscribe from the list, please visit
>> https://eur02.safelinks.protection.outlook.com/?
> url=https%3A%2F%2Flists.opencms.org%2Fmailman%2Flistinfo%2Fopencms-
> dev&data=05%7C02%7Cramon.gavira%40sagasoluciones.com%7Cf27862f8686840fbb36908ddf154dd68%7Cf6b0987d77bc48e294799ca6dc648a37%7C0%7C0%7C638932069137275440%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C60000%7C%7C%7C&sdata=ef40xO1Ln1yeV0dETCxTc42%2F%2Bc%2Bp5XBdqbuh3VIAQcE%3D&reserved=0 <https://lists.opencms.org/mailman/listinfo/opencms-dev>
>>
>>
>>
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> https://eur02.safelinks.protection.outlook.com/?
> url=https%3A%2F%2Flists.opencms.org%2Fmailman%2Flistinfo%2Fopencms-
> dev&data=05%7C02%7Cramon.gavira%40sagasoluciones.com%7Cf27862f8686840fbb36908ddf154dd68%7Cf6b0987d77bc48e294799ca6dc648a37%7C0%7C0%7C638932069137303596%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C60000%7C%7C%7C&sdata=3i26gErH4GM2tX0fsIBS1YutL3o5s1RV2Zno3s%2Bjas4%3D&reserved=0 <https://lists.opencms.org/mailman/listinfo/opencms-dev>
>
>
>
More information about the opencms-dev
mailing list