Setting Virtuoso Base URL

Hey folks,

I have a question about setting the relative path for Virtuoso links.

I have a number of services deployed on my site, Virtuoso being one of them. To handle the different services, I’m using nginx to route traffic to the apprpriate containers based on the user’s path (standard path rewrites). For example, when users visit mysite.com/data their traffic is routed to the virtuoso container. When users visit mysite.com/, their traffic is routed to a different webapp in some other container.

I noticed that all of the link URLs from the virtuoso application are relative to the root. So if someone clicks on the Conductor link, they end up at mysite.com/conductor which is of course problematic-the correct address would be mysite.com/conductor. Another example is when they visit the sparql endpoint page, their queries are sent to mysite.com/sparql instead of mysite.com/data/sparql. Unfortunately this isn’t behavior that can be controlled through nginx since these are hard coded.

I believe that many applications allow end users to configure the base address for this exact reason. In my case, I would set it to either /data/ or mysite.com/data. Is it possible to do this with Virtuoso?

Thanks,

Thomas

Can you provide an overview of the container layout being deployed ie are all apps including Virtuoso external traffic needs to be routed to running on the same or separate containers ?

What nginx rules do you currently have in place for Virtuoso ?

What is the Virtuoso version and build date being used and is it a Virtuoso docker container or one setup manually being used ?

Hey thanks for the quick response!

Can you provide an overview of the container layout being deployed ie are all apps including Virtuoso external traffic needs to be routed to running on the same or separate containers ?

External traffic is getting routed to different containers based on the path that gets hit.

For example, the following path rule will redirect traffic to Virtuoso.
/slinky/virtuoso(/|$)(.*)

The root, /slinky forwards traffic to a different web application
/slinky(/|$)(.*)

The nginx rewrite target is set to the second capture group, /$2.

I’m using the openlink/virtuoso-opensource-7:latest docker image, which can be found on the openlink dockerhub.

An example of the behavior from Virtuoso —

On the landing page a series of 404's are observed where Virtuoso is attempting to access resources at slinky/default.css instead of slinky/virtuoso/default.css

This is similar to Virtual Directories in the sense that it involves proxying-the difference is that the other applications aren’t being managed by Virtuoso (ie Virtuoso isn’t the proxy).

Following the Virtual Directory path, I would deploy virtuoso at the root, mysite.com/ and proxy mysite.com/my_app1, mysite.com/app_2, mysite.com/virtuoso, etc.

Many of the Virtuoso web server pages use absolute rather the relative paths within. The stack overflow post Nginx reverse proxy configuration to handle absolute paths details how ngnix can be configured to handle absolute paths using the HttpSubModule. Have you tried using this ?