Hello galaxians,

I'm currently trying to set up a production galaxy and make it available to the public but I face a weird issue, probably because of my nginx proxy configuration.

Galaxy is on a kvm virtual machine running on a host using nginx as proxy.

to make it a bit clearer:

172.30.24.35 (client) ---> http://172.30.24.63/machine1 (Host & nginx proxy) --- > http://192.168.122.254:8080/ (virtual machine)


I can connect to galaxy but when logging in, the virtual machine redirects me on 192.168.122.254:8080, which is unreachable from the 172.30.24.0 network. If I log in from the Host, it's all fine.




in the universe_wsgi.ini, i've set:

# Define the proxy-prefix filter.
[filter:proxy-prefix]
use = egg:PasteDeploy#prefix
prefix = /machine1

...

# [filter:proxy-prefix] section above.
filter-with = proxy-prefix

as described in the documentation.




My virtual machine nginx conf file:

user  galaxy;
worker_processes  2;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       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  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    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)";

    upstream galaxy_app{
        server localhost:8080;
    }
    server {
        client_max_body_size 10G;
        listen 80;
        server_name localhost;

        #charset koi8-r;
        #access_log logs/host.access.log main;

        location /machine1 {
            proxy_pass http://galaxy_app;
            proxy_set_header Host $host;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }
        location /machine1/static {
            alias /home/galaxy/galaxy-dist/static;
        }
        location /machine1/static/style {
            alias /home/galaxy/galaxy-dist/static/june_2007_style/blue;
        }
        location /machine1/static/scripts {
            alias /home/galaxy/galaxy-dist/static/scripts/packed;
        }
        location /machine1/favicon.ico {
            alias /home/galaxy/galaxy-dist/static/favicon.ico;
        }
        location /machine1/robots.txt {
            alias /home/galaxy/galaxy-dist/static/robots.txt;
        }
        location /_x_accel_redirect/ {
            internal;
            alias /machine1;
        }

        #error_page 404    /404.html;
        #redirect server error pages to the static page /50x.html
        #
        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
            root html;
        }
    }
}




And my host configuration :


server {
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;

    root /usr/share/nginx/html;
    index index.html index.htm;

    # Make site accessible from http://localhost/
    server_name localhost;

    location / {
        try_files $uri $uri/ =404;
    }

    location /machine1 {
        proxy_pass http://192.168.122.254:8080;   
    }
}