suchen

Heim  >  Fragen und Antworten  >  Hauptteil

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"

端口访问:

域名访问:

怪我咯怪我咯2779 Tage vor772

Antworte allen(3)Ich werde antworten

  • 黄舟

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

    Q助,求高手

    Antwort
    0
  • 高洛峰

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

    stackoverflow上的回答

    Antwort
    0
  • 阿神

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

    $ sudo chmod -R 755 yourapp/

    or

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

    Antwort
    0
  • StornierenAntwort