URL-based direct access to an openIMIS page

openIMIS modular frontend is the Javascript/React application that runs on the client computer. Therefore, the server won't know the full URL used within the frontend application (there is no folder or files matching those URLs). In order to still be able to use URL to access an openIMIS page, a URL rewriting rule is required.


The frontend is able to receive a GET parameter that will provide with the page to load first. This parameter is dyn and must contain a valid application PATH, encoded using the base64 method.

OpenResty (NGINX)

In the nginx configuration file, a rewrite rule is required under the front location:

if ($request_uri ~* /front/(?![Ss]tatic)([^/]+/[^\?]+)(?:\?(.*))? ){ set_encode_base64 $digest $1; rewrite ^/front/.*$ /front/?dyn=$digest; }

This rule will transform all URLs under the “front“ route that target a file in a subfolder different than “static“.

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. https://creativecommons.org/licenses/by-sa/4.0/