Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HistomicsUI doesnt show/load Image using nginx reverse proxy for girder. #326

Closed
Arnob-98 opened this issue Aug 11, 2023 · 8 comments
Closed

Comments

@Arnob-98
Copy link

Hi,
I am stuck while deplying histomicsUI with girder . I have installed histomicsUI plugin in girder, then i have configured nginx reverse proxy for my server to be visible on my local network. However when I open an image using HistomicsUI on remote computer, I could see the UI loads but no images or annotation panel is being shown. This is not a problem on my local device where it works perfectly. I am not exactly sure why as i am quite new to this.
this is my nginx server plugin

server {
  listen 80;
  listen [::]:80 ipv6only=on;
  root /usr/share/nginx/html;
  index index.html index.htm;

  server_name localhost;

  location / {
    allow all;

    # Disable nginx access logs for this location
    access_log on;

    # Set the root directory for this location
    root ~/Downloads/;
    try_files $uri $uri/ =404;
  }
  location /girder/ {
    allow all;
    access_log on;
    proxy_set_header Host $proxy_host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_pass http://0.0.0.0:8080/;
    # Must set the following for SSE notifications to work
    proxy_buffering off;
    proxy_cache off;
    proxy_set_header Connection '';
    proxy_http_version 1.1;
    chunked_transfer_encoding off;
    proxy_read_timeout 600s;
    proxy_send_timeout 600s;
  }
  client_max_body_size 500M;
}

and my girder config

[global]
server.socket_host = "0.0.0.0"
tools.proxy.on = True

[server]
api_root = "/api/v1"
static_public_path = "/static"

Thanks a lot and Great work btw.

@dgutman
Copy link
Contributor

dgutman commented Aug 11, 2023 via email

@Arnob-98
Copy link
Author

here's my current config for one of my servers server { listen 80 default_server; listen [::]:80 default_server; server_name digitalslidearchive.fully.qualified.server.name; client_max_body_size 500M; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; add_header X-Frame-Options DENY; location / { proxy_set_header Host $proxy_host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass http://localhost:8080/; proxy_buffering off; proxy_cache off; proxy_set_header Connection ''; proxy_http_version 1.1; chunked_transfer_encoding off; proxy_read_timeout 600s; proxy_send_timeout 600s; # proxy_request_buffering option only works on nginx >= 1.7.11 # but is necessary to support streaming requests proxy_request_buffering off; } listen [::]:443 ssl ipv6only=on; # managed by Certbot listen 443 ssl; # managed by Certbot ssl_certificate /etc/letsencrypt/live/DVcert/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/DVcert/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot } NOTE THE STUFF AT THE VERY BOTTOM RE: 443 was inserted by certbot when i set up my certificates..) The only thing I changed otherwise was server_name digitalslidearchive.fully.qualified.server.name; <<< That's not a real HOSTNAME :-) also I use certbot-nginx plugin 99% of the time to deal with the SSL setup..

On Fri, Aug 11, 2023 at 1:48 PM Arnob-98 @.> wrote: Hi, I am stuck while deplying histomicsUI with girder . I have installed histomicsUI plugin in girder, then i have configured nginx reverse proxy for my server to be visible on my local network. However when I open an image using HistomicsUI on remote computer, I could see the UI loads but no images or annotation panel is being shown. This is not a problem on my local device where it works perfectly. I am not exactly sure why as i am quite new to this. this is my nginx server plugin server { listen 80; listen [::]:80 ipv6only=on; root /usr/share/nginx/html; index index.html index.htm; server_name localhost; location / { allow all; # Disable nginx access logs for this location access_log on; # Set the root directory for this location root ~/Downloads/; try_files $uri $uri/ =404; } location /girder/ { allow all; access_log on; proxy_set_header Host $proxy_host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass http://0.0.0.0:8080/; # Must set the following for SSE notifications to work proxy_buffering off; proxy_cache off; proxy_set_header Connection ''; proxy_http_version 1.1; chunked_transfer_encoding off; proxy_read_timeout 600s; proxy_send_timeout 600s; } client_max_body_size 500M; } and my girder config [global] server.socket_host = "0.0.0.0" tools.proxy.on = True [server] api_root = "/api/v1" static_public_path = "/static" Thanks a lot and Great work btw. — Reply to this email directly, view it on GitHub <#326>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFODTXMVGOLIY5GY2DOG43XUZWABANCNFSM6AAAAAA3NHD2U4 . You are receiving this because you are subscribed to this thread.Message ID: @.>
-- David A Gutman, M.D. Ph.D. Associate Professor of Pathology Emory University School of Medicine

Thanks for your rapid reply. Unfortunately it doesnt fix the issue, here is the modified config file, Note that I am using My public Ip, not a domain name.

server {
        listen 80;
        listen [::]:80;


        server_name my_public_ip;
        client_max_body_size 500M;

        add_header Strict-Transport-Security "max-age=31536000;
        includeSubDomains" always;
        add_header X-Frame-Options DENY;

 location / {
    proxy_set_header Host $proxy_host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_pass http://0.0.0.0:8080/;
    proxy_buffering off;
    proxy_cache off;
    proxy_set_header Connection '';
    proxy_http_version 1.1;
    chunked_transfer_encoding off;
    proxy_read_timeout 600s;
    proxy_send_timeout 600s;
    # proxy_request_buffering option only works on nginx >= 1.7.11
    # but is necessary to support streaming requests
    proxy_request_buffering off;
        }




    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/nginx/ssl/nginx-selfsigned.crt;
    ssl_certificate_key /etc/nginx/ssl/nginx-selfsigned.key;

    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

}

also I have noticed while i open the image using OpenSeaDragon inside girder, The image is being shown, but when using GeoJs it doest work. Since HistomicsUI uses geojs as its default image viewer, the problem could be related to that, I'm not really sure.

@Arnob-98
Copy link
Author

Okay, It turns out that only firefox works properly with geojs, all the other browser doesnt load image in HistomicsUI, any idea why its happening?

@dgutman
Copy link
Contributor

dgutman commented Aug 12, 2023 via email

@Arnob-98
Copy link
Author

Arnob-98 commented Aug 12, 2023

I am using on Windows 11 , but the server is running on linux,(Ubuntu-18.04)

@Arnob-98
Copy link
Author

Any Update,sir?

@manthey
Copy link
Contributor

manthey commented Aug 31, 2023

We test the proxy settings as part of the digital_slide_archive CI -- see the files in https://github.com/DigitalSlideArchive/digital_slide_archive/tree/master/.circleci for the exact options used. We use this in our reference deployment at https://demo.kitware.com/histomicstk/.

@manthey
Copy link
Contributor

manthey commented May 22, 2024

Closing this. Please reopen if needed.

@manthey manthey closed this as completed May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants