首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在Ubuntu上通过NGINX配置shiny-server运行?

如何在Ubuntu上通过NGINX配置shiny-server运行?
EN

Stack Overflow用户
提问于 2017-02-18 22:02:58
回答 2查看 1.7K关注 0票数 3

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

代码语言:javascript
复制
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时,闪亮的欢迎页面被显示出来,但是"hello“和"rmd”这两个应用程序没有运行(见下面的截图)。

有没有人知道我到底做错了什么?

如果能帮上忙,我们将非常感激。

卡斯珀

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2017-02-19 02:27:28

nginx中的默认文件"sites-available“应该是这样的。记住还要配置R shiny服务器文件。

代码语言:javascript
复制
server {
    listen 80;

    location / {
        proxy_pass http://127.0.0.1:8080/;
            proxy_redirect http://127.0.0.1:8080/ $scheme://$host/;
            auth_basic "Username and Password are required"; 
            auth_basic_user_file /etc/nginx/.htpasswd;
    }
}
票数 0
EN

Stack Overflow用户

发布于 2017-06-27 16:23:55

您也需要在nginx的cofiguration文件中添加您的app的位置,例如:

代码语言:javascript
复制
location /hello {
    proxy_bind 127.0.0.1;
    proxy_pass http://localhost:8080/hello;
}
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42316113

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档