Our current setup for dataset browser, nginx and portal looks like this:
In the mysql database there's an entry for the browser_uri for each dataset.
The browser checks what port it is running on and based on that chooses what mongodb to use.
nginx routes to the correct browser based on sub-domain.
The problem with this is that we need to add information about what database/url the browser has in all these three places. I suggest the following setup:
We remove the entry in the database about browser_uri. We can do that since the browser should live at https://swefreq.nbis.se/dataset/<Dataset name>/browser. We also make sure that the database name in mongo is the same as the short_name in mysql.
The same as above.
nginx asks the python backend (not browser) what browser to route to. This is done the same way as for the downloadable files where nginx send the request to the backend which validates the user and then does an internal redirect. The backend can tell nginx this since the backend can read the config file.
We will probably need to setup a backend upstream for each browser instance in the nginx config. The config for the browser is created by ansible so this shouldn't be too difficult. If we read the config file that is created when provisioning we can also use that to add the routes, which would get rid of the backend roundtrip to figure out the correct browser.
Our current setup for dataset browser,
nginx
and portal looks like this:browser_uri
for each dataset.nginx
routes to the correct browser based on sub-domain.The problem with this is that we need to add information about what database/url the browser has in all these three places. I suggest the following setup:
browser_uri
. We can do that since the browser should live athttps://swefreq.nbis.se/dataset/<Dataset name>/browser
. We also make sure that the database name in mongo is the same as theshort_name
in mysql.nginx
asks the python backend (not browser) what browser to route to. This is done the same way as for the downloadable files wherenginx
send the request to the backend which validates the user and then does an internal redirect. The backend can tellnginx
this since the backend can read the config file.We will probably need to setup a backend upstream for each browser instance in the nginx config. The config for the browser is created by ansible so this shouldn't be too difficult. If we read the config file that is created when provisioning we can also use that to add the routes, which would get rid of the backend roundtrip to figure out the correct browser.