【发布时间】:2017-08-31 17:18:44
【问题描述】:
它在亚马逊服务器上,所以我查看了以下帖子: Changing Apache document root on AWS EC2 does not work 和 How to edit httpd.conf file in AMAZON EC2 或者一般来说:How do I change the root directory of an apache server? 到目前为止,所提供的信息确实对我有所帮助。 我可以在 etc/apache2 文件夹中找到的唯一文件如下:
编辑:配置文件的内容是: "别名 /javascript /usr/share/javascript/
选项 FollowSymLinks 多视图 "
两个月前我在他的网站上问过:http://www.louisaslett.com/RStudio_AMI/,但没有得到答案。
我的问题:如何更改 RStudio AMI 服务器上的文档根目录,以便我可以将 rstudio 登录页面的目录从根目录更改为 - 比如说 - domain.com/login 并拥有一个登录页面+ 根目录 (domain.com) 上的其他文件夹。
感谢您的帮助!
编辑: 在 Frédéric Henri 的回答和编辑之后:
这是我的 rstudio.conf 文件的内容。
location / {
proxy_pass http://localhost:8787;
proxy_redirect http://localhost:8787/ $scheme://$host/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_read_timeout 20d;
access_log /var/log/nginx/rstudio-access.log;
error_log /var/log/nginx/rstudio-error.log;
}
假设我在目录 /home/idx/index.html 中有 index.html 文件,那么我将如何更改该文件。 以下对我不起作用:
proxy_pass http://localhost/home/idx;
proxy_redirect http://localhost/home/idx/ $scheme://$host/;
或者:
proxy_pass /home/idx;
proxy_redirect /home/idx/ $scheme://$host/;
以及我将在哪里配置以将我的 rstudio 登录重定向到。 谢谢!
【问题讨论】:
-
你能把列出的conf文件的内容贴出来吗?
-
感谢您的评论。我在帖子中进行了编辑。
标签: r ubuntu amazon-ec2 rstudio amazon-ami