【问题标题】:unable to start nginx on ubuntu12.04 (precise) with rstudio无法使用 rstudio 在 ubuntu12.04(精确)上启动 nginx
【发布时间】:2012-09-14 03:08:40
【问题描述】:

我正在使用 rstudio 在 EC2 上运行远程服务器,并希望按照文档 here using nginx 中的说明设置反向代理

当我启动或重新启动 nginx 时,我收到如下所示的错误消息。显然,80 端口上没有运行其他任何东西。我没有安装 apache 或任何其他网络服务器。

ubuntu@ip-10-4-xxx-xxx:~$ sudo fuser -k 80/tcp ; sudo /etc/init.d/nginx restart
Restarting nginx: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
nginx.

我添加到ngnix.conf的模块是推荐的sn-p:

http {
  server {
    listen 80;

    location / {
      proxy_pass http://localhost:8787;
      proxy_redirect http://localhost:8787/ $scheme://$host/;
    }
  }
}

我确实尝试使用 8080 而不是 80,并且 ngnix 可以正常启动,但无法连接到 rstudio。 rstudio 同时在 8787 上可用。感觉我在这里错过了一些非常简单的东西。请帮忙!!

【问题讨论】:

    标签: r nginx rstudio


    【解决方案1】:

    哇哦。。在完整输入问题后才知道。 conf 文件有一个必须注释掉的包含

    include /etc/nginx/sites-enabled/*;
    

    改为

    #include /etc/nginx/sites-enabled/*;
    

    现在完美运行。有人@rstudio 请更新我上面显示的链接中的文档

    更新:请在下面的评论中查看@DirkEddelbuettel 的回复。正确的方法是将此代码 sn-p 添加到“启用站点”目录中的适当文件中。

    【讨论】:

    • 我认为你做错了——我认为你添加的配置应该在“启用站点”子目录的文件中。
    • @DirkEddelbuettel 你是对的。应该在启用的站点文件夹中。更新我的答案。
    猜你喜欢
    • 1970-01-01
    • 2018-08-30
    • 2017-01-16
    • 2015-08-09
    • 2015-09-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多