gpt4 book ai didi

nginx - 如何配置 Shiny 服务器在 Ubuntu 上通过 NGINX 运行?

转载 作者:行者123 更新时间:2023-12-03 03:32:40 26 4
gpt4 key购买 nike

我正在尝试配置 NGINX 服务器,以便 Shiny 的服务器和 Shiny 的应用程序可以通过 NGINX 运行,并具有适当的密码保护。我的 NGINX 默认文件如下例所示:

server {
listen 80 default_server;
listen [::]:80 default_server;

root /srv/shiny-server/;
#index index.html;

# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;

server_name _;

location / {
proxy_bind 127.0.0.1;
proxy_pass http://localhost:8080/;
proxy_redirect http://localhost:8080/ $scheme://$host/;
auth_basic "Username and Password are required";
auth_basic_user_file /etc/nginx/.htpasswd;

try_files $uri $uri/ =404;
}
}

当我转到 localhost:80 时,会显示 Shiny 的欢迎页面,但两个应用程序“hello”和“rmd”不会运行(请参见下面的屏幕截图)。 enter image description here

有人知道我在这里做错了什么吗?

我们将非常感谢您的帮助。

卡斯帕

最佳答案

您还需要在nginx的配置文件中添加您的应用程序的位置,例如:

location /hello {
proxy_bind 127.0.0.1;
proxy_pass http://localhost:8080/hello;
}

关于nginx - 如何配置 Shiny 服务器在 Ubuntu 上通过 NGINX 运行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42316113/

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