node.js - nginx 部署nodejs 绑定域名出现502 无权限
怪我咯
怪我咯 2017-04-17 12:02:47
0
3
761

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"

端口访问:

域名访问:

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(3)
黄舟

Q for help, seek help from experts

小葫芦

Answer on stackoverflow

阿神
$ sudo chmod -R 755 yourapp/

or

$ sudo chown -R ${your username}:${your username} yourapp/
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!