Question: Production Galaxy Nginx Config
0
gravatar for fire_water
4.0 years ago by
fire_water10
United States
fire_water10 wrote:

Hi,

I am trying to setup a local production Galaxy running on Ubuntu, Nginx, PostgreSQL, and ProFTD. When visiting http://localhost, "502 Bad Gateway" is returned. Visiting https://localhost returns "unable to connect". I was expecting to see the Galaxy website instead.

My Nginx configuration file is included below. Thank you for your help.

 


/etc/nginx/nginx.conf

user www-data;
worker_processes 4;
pid /run/nginx.pid;

events {
    worker_connections 768;
    # multi_accept on;
}

http {

    ##
    # Basic Settings
    ##

    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 65;
    types_hash_max_size 2048;
    # server_tokens off;

    # server_names_hash_bucket_size 64;
    # server_name_in_redirect off;

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

    ##
    # Logging Settings
    ##

    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;

    ##
    # Gzip Settings
    ##

    gzip on;
    gzip_http_version 1.1;
    gzip_vary on;
    gzip_comp_level 4;
    gzip_proxied any;
    gzip_types text/plain text/css application/x-javascript text/xml application/xml text/javascript application/json;
    gzip_buffers 16 8k;
    gzip_disable "MSIE [1-6].(?!.*SV1)";

    ##
    # nginx-naxsi config
    ##
    # Uncomment it if you installed nginx-naxsi
    ##

    #include /etc/nginx/naxsi_core.rules;

    ##
    # nginx-passenger config
    ##
    # Uncomment it if you installed nginx-passenger
    ##
    
    #passenger_root /usr;
    #passenger_ruby /usr/bin/ruby;

    ##
    # Virtual Host Configs
    ##

    include /etc/nginx/conf.d/*.conf;
    #include /etc/nginx/sites-enabled/*;

    ##
    # Galaxy
    ##

    upstream galaxy_app {
        # As defined in galaxy config file universe_wsgi.ini
        server localhost:8080;
        server localhost:8081;
        server localhost:8082;
        server localhost:8083;
        server localhost:8084;
        server localhost:8085;
        server localhost:8086;
        server localhost:8087;
        server localhost:8088;
        server localhost:8089;
    }

    server {
        # Maximum upload size that can be handled by POST requests through nginx.
        # Disabled because using FTP instead of web interface.
        #client_max_body_size 10G;

        location / {
            proxy_pass   http://galaxy_app;
            proxy_set_header   X-Forwarded-Host $host;
            proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
            # If using SSL, makes Galaxy aware of what type of URL it should generate for external sites like Biomart.
            proxy_set_header   X-URL-SCHEME https;
        }

        # nginx is more efficient at serving static content.
        # expires 24h is for caching purposes.
        location /static {
            alias /home/galaxy/galaxy-dist/static;
            expires 24h;
        }
        location /static/style {
            alias /home/galaxy/galaxy-dist/static/june_2007_style/blue;
            expires 24h;
        }
        location /static/scripts {
            alias /home/galaxy/galaxy-dist/static/scripts/packed;
        }
        location /favicon.ico {
            alias /home/galaxy/galaxy-dist/static/favicon.ico;
        }
        location /robots.txt {
            alias /home/galaxy/galaxy-dist/static/robots.txt;
        }

        # Use nginx to send files (downloads) instead of Galaxy.
        location /_x_accel_redirect/ {
            internal;
            alias /;
        }
    }
}

 


/var/log/nginx/error.log

2014/11/25 15:43:21 [error] 56433#0: *23 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8089/", host: "localhost"
2014/11/25 15:43:21 [error] 56433#0: *23 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "localhost"
2014/11/25 15:43:21 [error] 56433#0: *23 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8081/", host: "localhost"
2014/11/25 15:43:21 [error] 56433#0: *23 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8082/", host: "localhost"
2014/11/25 15:43:21 [error] 56433#0: *23 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8083/", host: "localhost"
2014/11/25 15:43:21 [error] 56433#0: *23 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8084/", host: "localhost"
2014/11/25 15:43:21 [error] 56433#0: *23 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8085/", host: "localhost"
2014/11/25 15:43:21 [error] 56433#0: *23 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8086/", host: "localhost"
2014/11/25 15:43:21 [error] 56433#0: *23 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8087/", host: "localhost"
2014/11/25 15:43:21 [error] 56433#0: *23 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8088/", host: "localhost"
production galaxy nginx • 4.3k views
ADD COMMENTlink modified 4.0 years ago by tuto34520 • written 4.0 years ago by fire_water10
0
gravatar for Bjoern Gruening
4.0 years ago by
Bjoern Gruening5.1k
Germany
Bjoern Gruening5.1k wrote:

Hi,

have a look at our galaxy-docker image. Here you can find configuration files for nginx, proftp and Co.!

https://github.com/bgruening/docker-galaxy-stable

Cheers,

Bjoern

ADD COMMENTlink written 4.0 years ago by Bjoern Gruening5.1k
0
gravatar for tuto345
4.0 years ago by
tuto34520
France
tuto34520 wrote:

Hi,

I recently had the same kind of problem in Centos 7 and it came from selinux. I checked for AVC entries related to nginx in /var/log/audit/audit.log and generated a policy to load in the system.

$ grep nginx /var/log/audit/audit.log | audit2allow -M mypolicy

Change the mypolicy to something more informative...

And follow the instructions that are given. It usually took several iterations until all permissions were detected and included in the policy, so I removed the policy (semodule -r mypolicy) and reloaded it (semodule -i mypolicy.pp) just to be sure.

Hope it helps!

Cristian

ADD COMMENTlink written 4.0 years ago by tuto34520
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 169 users visited in the last hour