I have an professional version of RStudio Connect. For some reason Connect does not work with basic SAML integration, if your install is behind a LB or Proxy. I am getting an error which many others have gotten:
{"code":97,"error":"Changing host or scheme in redirect is forbidden.","payload":null}
Based on information given by RStudio Admins, this error is due to Connect not being satisfied with the HTTP headers that its getting in requests. It seems Ngnix reverse proxy is the solution for this, and while I have followed guidance in setting this up. I am still getting the above error.
Below is my Ngnix conf file
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
}
http {
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 /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
# default_type application/octet-stream;
# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
server_name fdsahl96ceb1b2;
location / {
#rewrite ^/connect/(.*)$ /$1 break;
proxy_set_header X-RSC-Request scheme://$host:$server_port$request_uri;
proxy_pass http://localhost:3939/;
proxy_redirect http://localhost:3939/ $scheme://$host/connect/;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_http_version 1.1;
#try_files $uri $uri/ =404;
}
}