我已经在我的 ubuntu14 上安装了 RStudio Server v0.98.507 和 Shiny Server v1.1.0.10000
我的 rstudio 代理设置已打开nginx 默认值
location /rstudio/ {
rewrite ^/rstudio/(.*)$ /$1 break;
proxy_pass http://localhost:8787;
proxy_redirect http://localhost:8787/ $scheme://$host/rstudio/;
}
那是我闪亮的服务器设置/etc/shiny-server/shiny-server.conf
# Define the user we should use when spawning R Shiny processes
run_as shiny;
# Define a top-level server which will listen on a port
server {
# Instruct this server to listen on port 3838
listen 3838;
# Define the location available at the base URL
location / {
# Run this location in 'site_dir' mode, which hosts the entire directory
# tree at '/srv/shiny-server'
site_dir /srv/shiny-server;
# Define where we should put the log files for this location
log_dir /var/log/shiny-server;
# Should we list the contents of a (non-Shiny-App) directory when the user
# visits the corresponding URL?
directory_index on;
}
}
我可以运行 rstudio 和shiny-server,但是,当我调用一个shiny示例时,例如
library(shiny)
runExample("01_hello")
当 RStudio 编译器提示时
Listening on http://'127.0.0.1':7146
该网址返回无效响应,此处显示我的 chrome 上的控制台
WebSocket connection to 'ws://mydomain.com/rstudio/p/7146/websocket/' failed: Error during WebSocket handshake: Unexpected response code: 404 mydomaion.com/rstudio/p/7146/shared/shiny.js:507
WebSocket is already in CLOSING or CLOSED state.
但是,当我删除 RStudio 的代理旁路时nginx 默认值 to
#location /rstudio/ {
# rewrite ^/rstudio/(.*)$ /$1 break;
# proxy_pass http://localhost:8787;
# proxy_redirect http://localhost:8787/ $scheme://$host/rstudio/;
# }
它可以从 RStudio 运行闪亮的应用程序。
我的问题是我如何配置 RStudio 和 Shiny 服务器,以便我可以删除 :8787 来运行 rstudio 和 :3838 来运行闪亮服务器。