Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Nginx&;node.js未知指令_Node.js_Nginx_Configuration_Http Proxy - Fatal编程技术网

Nginx&;node.js未知指令

Nginx&;node.js未知指令,node.js,nginx,configuration,http-proxy,Node.js,Nginx,Configuration,Http Proxy,我试图为nginx编写一个配置文件,但遇到以下错误: /etc/nginx/conf.d/mydomain.conf:24中的未知指令“proxy\u http\u version” 配置文件位置:/etc/nginx/conf.d/mydomain.conf Nginx版本:我已经安装了Nginx/1.0.15 这是我的配置文件。请帮我解决这个问题 upstream node_app { server 127.0.0.1:3000; server 127.0.0.1:3001;

我试图为nginx编写一个配置文件,但遇到以下错误:

/etc/nginx/conf.d/mydomain.conf:24中的未知指令“proxy\u http\u version”

配置文件位置:/etc/nginx/conf.d/mydomain.conf

Nginx版本:我已经安装了Nginx/1.0.15

这是我的配置文件。请帮我解决这个问题

upstream node_app {
    server 127.0.0.1:3000;
    server 127.0.0.1:3001;
}

server {
    listen 80;
    server_name mydomain.com;

    # !!! handle static content requests and serve with nginx !!! #
    location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|pdf|txt|tar|wav|bmp|rtf|js|flv|swf|html|htm)$ {
        root        /var/www/html/mydomain.com/public/;
    }

    # !!! handle dynamic content requests and serve with node defined in upstream node_app object. !!! #
    location ~* ^[^\.]+$ {
        proxy_redirect off;
        proxy_set_header   X-Real-IP            $remote_addr;
        proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Proto $scheme;
        proxy_set_header   Host                   $http_host;
        proxy_set_header   X-NginX-Proxy    true;
        proxy_set_header   Connection "";
        proxy_http_version 1.1;
        proxy_pass         http://node_app;
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html;
    }
 }

更新nginx!NGINX版本1.1.4中添加了proxy_http_版本功能,我有1.12.0,现在是2017年年中。仍然得到完全相同的错误。。。