我正在尝试配置一个NGINX服务器,这样一个闪亮的服务器和闪亮的应用程序就可以通过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时,闪亮的欢迎页面被显示出来,但是"hello“和"rmd”这两个应用程序没有运行(见下面的截图)。

有没有人知道我到底做错了什么?
如果能帮上忙,我们将非常感激。
卡斯珀
发布于 2017-02-19 02:27:28
nginx中的默认文件"sites-available“应该是这样的。记住还要配置R shiny服务器文件。
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;
}
}发布于 2017-06-27 16:23:55
您也需要在nginx的cofiguration文件中添加您的app的位置,例如:
location /hello {
proxy_bind 127.0.0.1;
proxy_pass http://localhost:8080/hello;
}https://stackoverflow.com/questions/42316113
复制相似问题