gpt4 book ai didi

以 https 模式运行 shinyapp

转载 作者:行者123 更新时间:2023-12-05 05:03:29 25 4
gpt4 key购买 nike

我想使用命令 shiny::runApp() 部署我的应用程序。我的问题是是否可以使用 https 而不是 http 来做到这一点(我无法安装 Shiny 的服务器)。

现在我以这种模式运行:shiny::runApp("app.R", port=3090, host="myipaddress")。我有一个指向 IP 地址的域,如果我在浏览器中写入:http://mydomain:3090工作正常。

我的问题是我找不到任何可从 http://mydomain:3090 切换的模式至 https://mydomain:3090 .

感谢任何帮助

最佳答案

正如 Sergio Romero 所建议的那样,我在 apache 上的 443 端口上使用了反向代理并处理了 ssl 证书。我关注了this guide在 Apache 上设置虚拟主机的配置

<VirtualHost *:443>
ServerName mydomainname

<Proxy *>
Allow from mydomainname
</Proxy>

RewriteEngine on
RewriteCond %{HTTP:Upgrade} =websocket
RewriteRule /(.*) ws://mydomainname:myport/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket
RewriteRule /(.*) http://mydomainname:myport/$1 [P,L]

ProxyPass / http://mydomainname:myport/
ProxyPassReverse / http://mydomainname:myport/
ProxyRequests Off

## SSL directives
SSLEngine on
SSLCertificateFile "path_to_cert.pem"
SSLCertificateKeyFile "path_to_privkey.pem"
SSLCertificateChainFile "path_to_fullchain.pem"
</VirtualHost>

关于以 https 模式运行 shinyapp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61618036/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com