Question: Configure Nginx for 2 differents Galaxy instance
0
gravatar for christophe.habib
3.6 years ago by
France
christophe.habib340 wrote:

Hi everyone,

I would like to run a second instance for my development, since the instance for production MUST be ok whatever I try on the other one. Plus, the new instance has a postgres db, and the old one has a mysql db.

To do so I guess that I need to configure nginx properly. For the first instance nginx was configured (by someone else) more or less as described here : https://wiki.galaxyproject.org/Admin/Config/nginxProxy

http {
    # ... other http stuff ...
    upstream galaxy_app {
        server localhost:4242;

        server {

                # Galaxy redirection
                client_max_body_size 10G;
                location /galaxy {
                        proxy_pass   http://galaxy_app;
                        proxy_set_header   X-Forwarded-Host $host;
                        proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
                }

                #PHP redirection
                location ~ \.php$ {
                        root /usr/share/nginx/www;
                        try_files $uri =404;
                        fastcgi_split_path_info ^(.+\.php)(/.+)$;
                        # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini

                        # With php5-cgi alone:
                        #fastcgi_pass 127.0.0.1:9000;
                        # With php5-fpm:
                        fastcgi_pass unix:/var/run/php5-fpm.sock;
                        fastcgi_index index.php;
                        include fastcgi_params;
                }

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

}

I tried several things to add my second instance, but nothing worked so far. For example i try to add this parts :

        upstream galaxy2_app {
                server localhost:4343;
        }

        server {

                # Galaxy redirection
                client_max_body_size 10G;
                location /galaxy2 {
                        proxy_pass   http://galaxy2_app;                

                        proxy_set_header   X-Forwarded-Host $host;
                        proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;

                        # here i tried with, and without the 2 previous lines
                }

                #PHP redirection
                location ~ \.php$ {
                        root /usr/share/nginx/www;
                        try_files $uri =404;
                        fastcgi_split_path_info ^(.+\.php)(/.+)$;
                        fastcgi_pass unix:/var/run/php5-fpm.sock;
                        fastcgi_index index.php;
                        include fastcgi_params;
                }

But obviously that could not be that simple. I guess my problem is about those 2 variables "X-Forwarded-Host" and "X-Forwarded-For" because I can't figure their meaning.

Can you help me to find which modification are needed to have 2 disctincts instance regulated by Nginx only?

Thank you,

Christ

 

 

ADD COMMENTlink modified 3.6 years ago • written 3.6 years ago by christophe.habib340
0
gravatar for christophe.habib
3.6 years ago by
France
christophe.habib340 wrote:

I tried something else :

 

        upstream galaxy_app {
                server localhost:4242;
        }
        ##
        upstream galaxy2_app {
                server localhost:4343;
        }

        # Server config
        ##
        server {

                # Galaxy redirection
                client_max_body_size 10G;
                location /galaxy {
                        proxy_pass   http://galaxy_app;
                        proxy_set_header   X-Forwarded-Host $host;
                        proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
                }
                location /galaxy2 {
                        proxy_pass   http://galaxy2_app;
                        proxy_set_header   X-Forwarded-Host $host;
                        proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
                }
                

                #PHP redirection
                location ~ \.php$ {
                        root /usr/share/nginx/www;
                        try_files $uri =404;
                        fastcgi_split_path_info ^(.+\.php)(/.+)$;
                        # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini

                        # With php5-cgi alone:
                        #fastcgi_pass 127.0.0.1:9000;
                        # With php5-fpm:
                        fastcgi_pass unix:/var/run/php5-fpm.sock;
                        fastcgi_index index.php;
                        include fastcgi_params;
                }

        }

It seems to work... but not really. I mean the page is white, with no font or image, where he asked me to register a new user. I did that and now I have this message :

Not Found

The resource could not be found.
The resource at http://galaxytest.fr/galaxy2/static/welcome.html could not be found

So it seems that I lack something. But I really don't understand "WHAT" because I see nothing more in the configuration of the first instance...

Help?

 

 

ADD COMMENTlink written 3.6 years ago by christophe.habib340

I forgot to say that on background of the error message I can read

"None

Tools

History"

ADD REPLYlink written 3.6 years ago by christophe.habib340
0
gravatar for christophe.habib
3.6 years ago by
France
christophe.habib340 wrote:

Hi everyone,

I found what was wrong in my Nginx config file. I needed to specify the absolute path of static file for my second instance in the server{} part.

The thing that perturbed me is that there is no such things for the first instance. The only static path present in others files are refering to path that does not exist anymore (Galaxy made by someone before me). So the 2 instances are running and are well displayed in my firefox, but I don't know why the first one works fine...

If you have any idea about that, please let me know.

Christ

ADD COMMENTlink written 3.6 years ago by christophe.habib340
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: 180 users visited in the last hour