I've a Kubernetes cluster on GKE that has a nginx ingress controller sitting on top to mapping the RStudio Server endpoint under /rstudio/. This works quite well.
Unfortunately, one of my deployments (RStudio Server) doensn't work properly because it uses client-side redirects during the login/logout which end ups in 404 error when trying to access /auth-login (it should be /rstudio/auth-login)
In the past, when using a non-containerized install of RStudio Server, I used to sit an Apache reverse proxy on front to handle url rewrites.
From the official RStudio Server Pro guide i see that adding this location
section to nginx.conf
should solve the problem.
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;
}
Can I use annotation on ingress controller to obtain the same results?
Although this doesn't end up with the same
nginx.conf
content, it seems to work. But i don't know if it could cause some side-effects (tested with one pod only atm).Maybe others would help commenting the answer about...