bigdataviewer / bigdataviewer-server

A web server for BigDataViewer datasets
GNU General Public License v3.0
3 stars 3 forks source link

BigDataServer behind a reverse-proxy #7

Closed lmo-reira closed 4 years ago

lmo-reira commented 4 years ago

Hi,

I'm trying to setup the bigdataserver behind a reverse-proxy, without success until now... I guess it's supposed to work, but maybe there is something specific to do to achieve my goal ?

My installation configuration

The problem

I can load the url (e.g http://bigdataserv.mysite.net) on the bigdataviewer plugin on ImageJ, but I don't have any images as a result.

reverseproxy-bigdataviewer-no-images

When I double click on any image, I got this log output :

reverse-proxy-bigdataviewer.log

Does anybody have any experience with this ?

Best regards,

tpietzsch commented 4 years ago

I have no experience with this, but probably it's the following. The json has URLs for thumbnailUrl and datasetUrl that point to http://192.168.50.100:8080/test2/png and http://192.168.50.100:8080/test2/ As you noted, these would have to have 192.168.50.100:8080 replaced by bigdataserv.mysite.net. There is currently no mechanism in bigdataserver to do this replacement.

As a workaround, you can open the datasetUrl with the replaced address in a browser (e.g., http://bigdataserv.mysite.net/test2/). This should give you a XML formatted document. Save this to a file dataset.xml. In that file, you will have at the top a <ImageLoader> section, something like

<ImageLoader format="bdv.remote">
  <baseUrl>
    http://192.168.50.100:8080/test2/
  </baseUrl>
</ImageLoader>

Replace the 192.168.50.100:8080 by bigdataserv.mysite.net. Then open dataset.xml through Fiji > Plugins > BigDataViewer > Open XML/HDF5 This way, you should at least be able to look at individual datasets, although the "Browse BigDataServer" will not work.

tpietzsch commented 4 years ago

I did a quick fix that now allows to replace the base URL with this commit https://github.com/bigdataviewer/bigdataviewer-server/commit/f53a3dccd4a1f6c70c91c200d2105e50292e7277

To create a bigdataserver jar that hast this option, check out the latest master. Build with

mvn clean package -P fatjar

This should create a fat jar (target/bigdataviewer-server-2.1.1-SNAPSHOT.jar)

This has an additional parameter flag -b baseURL.

So your example you should be able to do now with java -Xmx4G -jar bigdataserver.jar -d BigDataViewer/images.txt -s 192.168.50.100 -p 8080 -b http://bigdataserv.mysite.net

lmo-reira commented 4 years ago

Hi,

Thank you very much, it works perfectly with this new version !

Without this fix, I was about to run a script parsing the json to generate a web page with the image preview and the xml link, but finally it will not be needed !

Again, thank you very much !