如何摆脱Shiny app地址中的3838端口号

时间:2018-03-08 14:46:29

标签: shiny digital-ocean shiny-server

当我在DigitalOcean中托管我的Shiny应用程序时,我正在努力摆脱端口号3838。

到目前为止,我已经咨询了以下2个链接,但是对我来说没有任何作用: https://www.r-bloggers.com/shiny-server-series-part-2-running-shiny-on-multiple-ports/ https://deanattali.com/2015/05/09/setup-rstudio-shiny-server-digital-ocean/#shiny-user-perms

我有xampp作为我的网络服务器,目前听80,而闪亮到3838。 当我将http://ip-address:3838放在地址栏中时,我的Shiny应用程序运行正常。但是当我放http://ip-address/shiny/时,它不是。

以下是我的闪亮配置文件

# Instruct Shiny Server to run applications as the user "shiny"
run_as shiny;

# Define a server that listens on port 3838
server {
  listen 3838;

  # Define a location at the base URL
  location / {

    # Host the directory of Shiny Apps stored in this directory
    site_dir /opt/lampp/htdocs/My_App;

    # Log all Shiny output to files in this directory
    log_dir /var/log/shiny-server;

    # When a user visits the base URL rather than a particular application,
    # an index of the applications available in this directory will be shown.
    directory_index on;
  }
}

以下是xampp.conf文件中的一些相关部分:

# demo for mod_perl responsehandler
#PerlModule Apache::CurrentTime
#<Location /time>
#      SetHandler modperl
#      PerlResponseHandler Apache::CurrentTime
#</Location>

location /shiny/ {
  proxy_pass http://139.59.42.170/:3838/;

    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
}

当我将http://ip-address/shiny/放在地址栏中时,我希望我的Shiny应用程序正常工作。如果有人能指出我实现同样目标的正确方法,我将不胜感激。

谢谢,

0 个答案:

没有答案