部署 Nginx 部署两个 Rails 项目, 其中一个 mina deploy 报权限错误,请问怎么解决

zqalyc · August 22, 2013 · Last by zqalyc replied at August 22, 2013 · 3605 hits

mina 报错

Permission denied,please try agin

配置文件的信息:

upstream myapp{
server unix:/tmp/unicorn.hpp.sock;

}
server {
listen  80;
server_name hpp;
client_max_body_size 4G;
client_body_buffer_size 20M;
access_log /home/hmpuser/deploy/shared/log/access.log;
error_log /home/hmpuser/deploy/shared/log/error.log;
root      /home/hmpuser/deploy/current;
index    index.html;

location / { 
     proxy_set_header X-Real-IP  $remote_addr;
     proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;
     proxy_set_header  Host $http_host;
     proxy_redirect    off;
    try_files /system/maintenance.html $uri $uri/index.html $uri.html @user1;
}


server{
listen 80;
server_name rhh;
access_log /home/hmpuser/deploy/shared/log/access2.log;
error_log /home/hmpuser/deploy/shared/log/error2.log;
root  /home/hmpuser/deployRhea/current;
index index.html;
location /{
 proxy_set_header X-Real-IP $remote_addr;
 proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
 proxy_set_header   Host $http_host;
 proxy_redirect off;
 try_files /system/mainteance.html $uri $uri/index.html $uri.html @user2;
}
}
location @user3{
proxy_pass http://myap;
}
}

看在你也用樱木做头像,我偷偷告诉你:是否是另一个 mina 脚本的发布目录没有权限呢?问题不够详细哈,mina 发布和 nginx 没有什么关系

#1 楼 @suxu 谢谢啊。我帖了 nginx 的配置文件,你说的那个权限怎么查看?

你在服务器上,启动 nginx 没有报错吧

root  /home/hmpuser/deployRhea/current/public

#4 楼 @suxu 我在这个服务器上部署的第一个项目现在是可以正常运行,就是第二个 rhh 报错

#4 楼 @suxu 我按照你的改后还是报同样的错

查看你发布目录的权限,还有 mina 如果用的 git,有时也会有这个错误。你可以先到 服务器上。git 你的代码主机

#7 楼 @suxu 在服务器上 git clone 代码是没有问题的

#7 楼 @suxu 这是错误信息,帮我看一下吧,谢谢

1088#0: *139 connect() to unix:/tmp/unicorn.hpp.sock failed (2: No such file or directory) while connecting to upstream, client: 94.244.255.148, server: hpp, request: "GET / HTTP/1.1", upstream: "http://unix:/tmp/unicorn.hpp.sock:/", host: "166.111.128.120"

你一个 server 对应一个 upstream 啊

#10 楼 @suxu 嗯,需要怎么改一下?

@zqalyc 你 google 一下,nginx 发布多个应用。就是每个 server 对应一个 upstream。

#12 楼 @suxu 好的。谢谢啊

You need to Sign in before reply, if you don't have an account, please Sign up first.