nginx Proxy to VM problem

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

nginx Proxy to VM problem

Michael E. Cotterell
Hey everyone,

I'm having a weird login problem (think it's cookie related) after setting up Galaxy on a virtual machine and trying to proxy_pass to it using nginx. It says I'm logged in, but when I get redirected to the front page I'm no longer logged in. When I visit subsequent pages I'm also not logged in.

On the server, here is the relevant part of my nginx configuration (I'm going to setup static serving after I get the login issue resolved):

upstream galaxy_app {
  server 192.168.1.11:8080;
}


server {
  ...
  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;
  }


  ...
}

The dots just mean that I have other things in there for the forwarding I do with other VMs.

On the VM, in my universe_wsgi.ini file, I have made sure to set the following (just showing the parts I think are relevant):

[server:main]
port = 8080
host = 0.0.0.0

[filter:proxy-prefix]
use = egg:PasteDeploy#prefix
prefix = /galaxy



[app:main]
filter-with = proxy-prefix
cookie_path = /galaxy

I should note that I might end up changing this configuration to use a CNAME at some point (thus avoiding the prefix issue), but for now I'm totally lost as to why I'm not able to login using my current configuration.

Any ideas?

Thanks!

Sincerely,
Michael E. Cotterell

Ph.D. Student in Computer Science, University of Georgia
Instructor of Record, Graduate RA & TA, University of Georgia
[hidden email] (mailto:[hidden email])
[hidden email] (mailto:[hidden email])
[hidden email] (mailto:[hidden email])
http://michaelcotterell.com/


___________________________________________________________
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:
  http://lists.bx.psu.edu/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/
Reply | Threaded
Open this post in threaded view
|

Re: nginx Proxy to VM problem

Michael E. Cotterell
I actually fixed the problem by not setting the cookie prefix in the ini file. Weird.


Sincerely,
Michael E. Cotterell

Ph.D. Student in Computer Science, University of Georgia
Instructor of Record, Graduate RA & TA, University of Georgia
[hidden email] (mailto:[hidden email])
[hidden email] (mailto:[hidden email])
[hidden email] (mailto:[hidden email])
http://michaelcotterell.com/


On Wednesday, May 22, 2013 at 9:51 AM, Michael E. Cotterell wrote:

> Hey everyone,
>
> I'm having a weird login problem (think it's cookie related) after setting up Galaxy on a virtual machine and trying to proxy_pass to it using nginx. It says I'm logged in, but when I get redirected to the front page I'm no longer logged in. When I visit subsequent pages I'm also not logged in.
>
> On the server, here is the relevant part of my nginx configuration (I'm going to setup static serving after I get the login issue resolved):
>
> upstream galaxy_app {
> server 192.168.1.11:8080;
> }
>
>
> server {
> ...
> 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;
> }
>
>
> ...
> }
>
> The dots just mean that I have other things in there for the forwarding I do with other VMs.
>
> On the VM, in my universe_wsgi.ini file, I have made sure to set the following (just showing the parts I think are relevant):
>
> [server:main]
> port = 8080
> host = 0.0.0.0
>
> [filter:proxy-prefix]
> use = egg:PasteDeploy#prefix
> prefix = /galaxy
>
>
>
> [app:main]
> filter-with = proxy-prefix
> cookie_path = /galaxy
>
> I should note that I might end up changing this configuration to use a CNAME at some point (thus avoiding the prefix issue), but for now I'm totally lost as to why I'm not able to login using my current configuration.
>
> Any ideas?
>
> Thanks!
>
> Sincerely,
> Michael E. Cotterell
>
> Ph.D. Student in Computer Science, University of Georgia
> Instructor of Record, Graduate RA & TA, University of Georgia
> [hidden email] (mailto:[hidden email])
> [hidden email] (mailto:[hidden email])
> [hidden email] (mailto:[hidden email])
> http://michaelcotterell.com/



___________________________________________________________
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:
  http://lists.bx.psu.edu/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/
Reply | Threaded
Open this post in threaded view
|

Re: nginx Proxy to VM problem

Michael E. Cotterell
That's not the only thing I changed. I also have the following in my nginx conf file:

proxy_set_header Host $host;

instead of X-Forwarded-Host $host

Sincerely,
Michael E. Cotterell

Ph.D. Student in Computer Science, University of Georgia
Instructor of Record, Graduate RA & TA, University of Georgia
[hidden email] (mailto:[hidden email])
[hidden email] (mailto:[hidden email])
[hidden email] (mailto:[hidden email])
http://michaelcotterell.com/


On Wednesday, May 22, 2013 at 11:11 AM, Michael E. Cotterell wrote:

> I actually fixed the problem by not setting the cookie prefix in the ini file. Weird.
>
>
> Sincerely,
> Michael E. Cotterell
>
> Ph.D. Student in Computer Science, University of Georgia
> Instructor of Record, Graduate RA & TA, University of Georgia
> [hidden email] (mailto:[hidden email])
> [hidden email] (mailto:[hidden email])
> [hidden email] (mailto:[hidden email])
> http://michaelcotterell.com/
>
>
> On Wednesday, May 22, 2013 at 9:51 AM, Michael E. Cotterell wrote:
>
> > Hey everyone,
> >
> > I'm having a weird login problem (think it's cookie related) after setting up Galaxy on a virtual machine and trying to proxy_pass to it using nginx. It says I'm logged in, but when I get redirected to the front page I'm no longer logged in. When I visit subsequent pages I'm also not logged in.
> >
> > On the server, here is the relevant part of my nginx configuration (I'm going to setup static serving after I get the login issue resolved):
> >
> > upstream galaxy_app {
> > server 192.168.1.11:8080;
> > }
> >
> >
> > server {
> > ...
> > 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;
> > }
> >
> >
> > ...
> > }
> >
> > The dots just mean that I have other things in there for the forwarding I do with other VMs.
> >
> > On the VM, in my universe_wsgi.ini file, I have made sure to set the following (just showing the parts I think are relevant):
> >
> > [server:main]
> > port = 8080
> > host = 0.0.0.0
> >
> > [filter:proxy-prefix]
> > use = egg:PasteDeploy#prefix
> > prefix = /galaxy
> >
> >
> >
> > [app:main]
> > filter-with = proxy-prefix
> > cookie_path = /galaxy
> >
> > I should note that I might end up changing this configuration to use a CNAME at some point (thus avoiding the prefix issue), but for now I'm totally lost as to why I'm not able to login using my current configuration.
> >
> > Any ideas?
> >
> > Thanks!
> >
> > Sincerely,
> > Michael E. Cotterell
> >
> > Ph.D. Student in Computer Science, University of Georgia
> > Instructor of Record, Graduate RA & TA, University of Georgia
> > [hidden email] (mailto:[hidden email])
> > [hidden email] (mailto:[hidden email])
> > [hidden email] (mailto:[hidden email])
> > http://michaelcotterell.com/
>



___________________________________________________________
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:
  http://lists.bx.psu.edu/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/