5

I had RStudio Server v0.98.1103.

In my nginx config file, I added the following lines so that I can access it from /rstudio instead of :8787

location /rstudio/ {
  proxy_pass http://127.0.0.1:8787/;
  proxy_http_version 1.1;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection "upgrade";
}

I just updated to v0.99.896. Now when I go to the /rstudio URL and put in my credentials, it just goes back to the same login screen. If I put it wrong credentials then I do see an error, but if the credentials are right then the page simply "refreshes".

If I go to :8787 then I'm able to login.

Does anyone have any ideas why I can't login anymore?

Edit: When I downgrade back to the previous version, I can log in again.

DeanAttali
  • 25,268
  • 10
  • 92
  • 118
  • Not a direct answer, but does anything in https://support.rstudio.com/hc/en-us/articles/200552326-Running-RStudio-Server-with-a-Proxy help? – Kevin Ushey May 04 '16 at 17:06
  • @KevinUshey I just tried exactly the same conf settings as in that article, still seeing the same behaviour (click login, the page goes back to the same page all the time). After downgrading to the previous version, I can log in again. I'll try installing it on a fresh machine later to better isolate it – DeanAttali May 04 '16 at 17:20
  • What is your environment? I mean distro. And uname -a? – khrm May 20 '16 at 17:31
  • I cannot reproduce it. – khrm May 20 '16 at 18:55

1 Answers1

2

There are a few things missing from your config file. See this article for details on how to configure an nginx proxy to use an /rstudio prefix: https://support.rstudio.com/hc/en-us/articles/200552326-Running-RStudio-Server-with-a-Proxy

This is what the complete config should look like:

http {

  map $http_upgrade $connection_upgrade {
      default upgrade;
      ''      close;
  }

  server {
    listen 80;


    location /rstudio/ {
      rewrite ^/rstudio/(.*)$ /$1 break;
      proxy_pass http://localhost:8787;
      proxy_redirect http://localhost:8787/ $scheme://$host/rstudio/;
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection $connection_upgrade;
      proxy_read_timeout 20d;
    }
  }
}
JJ Allaire
  • 556
  • 3
  • 3
  • Thanks JJ. I did try adding those exact lines to my nginx config but it didn't change anything. Using this config did work on a brand new fresh machine, but there must be something else about my environment/configuration that is clashing with this. – DeanAttali May 05 '16 at 02:35