我的桌面上运行着 Rstudio,我可以通过http://my.desktop:8787从 Web 访问它。
从Rstudio 文档看来,设置反向代理是一种谨慎的安全措施(如果我错了,请纠正我)。
我正在使用 Ubuntu 11.04
按照该页面的说明,我安装了 ngnix 并将代码片段添加到/etc/nginx/nginx.conf
:
http {
server {
listen 80;
location / {
proxy_pass http://localhost:8787;
proxy_redirect http://localhost:8787/ $scheme://$host/;
}
}
}
sudo nginx restart -v
返回以下错误:
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
此外,如果我包含以下代码段(以便链接指向 /rstudio 而不是:8787):
location /rstudio/ {
rewrite ^/rstudio/(.*)$ /$1 break;
proxy_pass http://localhost:8787;
proxy_redirect http://localhost:8787/ $scheme://$host/rstudio/;
}
sudo nginx restart -v
返回以下错误:
Restarting nginx: nginx: [emerg] unknown directive "location" in
/etc/nginx/nginx.conf:93
我有两个问题:
- 如果我使用强密码,反向代理服务器的必要性有多大?
- 我怎样才能克服这些错误?