error ssl server docker-galaxy with nginx

Hi, I am new for galaxy and nginx. I run a galaxy-docker (galaxyproject/galaxy-min:22.05) on http://cloud_server_ip:8090/. The website can be accessed normally and the ‘welcome.html’ page is well shown. Files can be uploaded normally, too. But when I try to proxy galaxy with nginx, I can access the https://cloud_server_name/ but the ‘welcome.html’ is blank, and I can’t upload files. What’s wrong with my nginx.conf. I notice that a document describe how to serve galaxy with nginx (Proxying Galaxy with NGINX — Galaxy Project 23.3.dev0 documentation), but maybe docker version is different? My port and ssl certificates are normal.

# For more information on configuration, see:
#   * Official English Documentation: http://nginx.org/en/docs/
#   * Official Russian Documentation: http://nginx.org/ru/docs/

# user nginx;
user nginx;
worker_processes auto;
error_log /etc/nginx/log/error.log;
error_log /etc/nginx/log/error.log notice;
error_log /etc/nginx/log/error.log info;

pid /var/run/nginx.pid;

# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
# include /usr/share/nginx/modules/*.conf;

events {
    worker_connections 1024;
}

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /etc/nginx/log/access.log  main;
    
    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    # compress responses whenever possible
    gzip on;
    gzip_http_version 1.1;
    gzip_vary on;
    gzip_comp_level 4;
    gzip_proxied any;
    gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
    gzip_buffers 16 8k;

    # allow up to 3 minutes for Galaxy to respond to slow requests before timing out
    proxy_read_timeout 180;

    # maximum file upload size
    client_max_body_size 10g;

    # Enable HSTS
    add_header Strict-Transport-Security "max-age=15552000; includeSubdomains";

    server {
        listen 80;
        listen 443 ssl;
        server_name  localhost;
        server_name  cloud.abc.cn;
        
        keepalive_timeout          3000s;
        client_max_body_size       50m;
        
        ## ssl on;
        ssl_certificate /etc/nginx/cert/cloud.abc.cn.pem;
        ssl_certificate_key /etc/nginx/cert/cloud.abc.cn.key;
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
        ssl_prefer_server_ciphers on;
        
        ## enable session reuse
        ssl_session_cache shared:SSL:8m;
        ssl_session_timeout 5m;
        
        location / {
            proxy_pass http://192.168.77.1:8090/;
            proxy_set_header  Host             $host;
            proxy_set_header  X-Real-IP        $remote_addr;
            proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;
            proxy_set_header  X-Forwarded-Protocol $scheme;
            proxy_set_header Upgrade $http_upgrade;
        }
        
    }
}

For 22.05 you should check the proper version of the documentation: Proxying Galaxy with NGINX — Galaxy Project 22.05.1 documentation.

That said if the welcome page is not loading check the browser console and you will see where it is looking, then check the logs of nginx and the actual location of the files.

1 Like