登录

node.js - nginx 部署nodejs 绑定域名出现502 无权限

nginx配置:

server {
    listen 80;
    server_name blog.caesar.com;

    location ~ {
        proxy_pass http://127.0.0.1:3000;
    }

    root  /usr/local/src/microblog/;
    # access_log /home/wssgcg1213/NB/nginx.access.log;
    # error_log /home/wssgcg1213/NB/nginx.error.log;

    index index.html index.php;
    autoindex off;

    location ~* .*\.(gif|jpg|jpeg|png|bmp|ico|css|js|txt|flv|swf|mid|doc|ppt|xls|pdf|txt|mp3|wma)$ {
            expires 2d;
    }

}

nginx错误:

2015/07/24 01:24:45 [crit] 4584#0: *11 connect() to 127.0.0.1:3000 failed (13: Permission denied) while connecting to upstream, client: 127.0.0.1, server: blog.caesar.com, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "blog.caesar.com"
2015/07/24 01:24:46 [crit] 4584#0: *11 connect() to 127.0.0.1:3000 failed (13: Permission denied) while connecting to upstream, client: 127.0.0.1, server: blog.caesar.com, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "blog.caesar.com"
2015/07/24 01:24:47 [crit] 4584#0: *11 connect() to 127.0.0.1:3000 failed (13: Permission denied) while connecting to upstream, client: 127.0.0.1, server: blog.caesar.com, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "blog.caesar.com"
2015/07/24 01:24:48 [crit] 4584#0: *11 connect() to 127.0.0.1:3000 failed (13: Permission denied) while connecting to upstream, client: 127.0.0.1, server: blog.caesar.com, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "blog.caesar.com"
2015/07/24 01:24:50 [crit] 4584#0: *11 connect() to 127.0.0.1:3000 failed (13: Permission denied) while connecting to upstream, client: 127.0.0.1, server: blog.caesar.com, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "blog.caesar.com"
2015/07/24 01:24:51 [crit] 4584#0: *11 connect() to 127.0.0.1:3000 failed (13: Permission denied) while connecting to upstream, client: 127.0.0.1, server: blog.caesar.com, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "blog.caesar.com"

端口访问:

域名访问:

# Node.js
怪我咯怪我咯2142 天前536 次浏览

全部回复(3) 我要回复

  • 黄舟

    黄舟2017-04-17 12:04:47

    Q助,求高手

    回复
    0
  • 高洛峰

    高洛峰2017-04-17 12:04:47

    stackoverflow上的回答

    回复
    0
  • 阿神

    阿神2017-04-17 12:04:47

    $ sudo chmod -R 755 yourapp/

    or

    $ sudo chown -R ${your username}:${your username} yourapp/

    回复
    0
  • 取消回复发送