python – 为tornadoweb配置失败nginx设置,未知指令“user”

我在Nginx版本1.0.0中遇到此错误

Nginx: [emerg] unkNown directive "user" in /etc/Nginx/sites-enabled/
tornado:1

如果我删除用户www-data,则工作进程出错

Nginx: [emerg] unkNown directive "worker_processes" in /etc/Nginx/
sites-enabled/tornado:1

我在谷歌搜索但仍然没有得到任何结果
请帮忙

这是我在网站上的龙卷风

user www-data www-data;
worker_processes 1;

error_log /var/log/Nginx/error.log;
pid /var/run/Nginx.pid;

events {
    worker_connections 1024;
    use epoll;

}

http {
    # Enumerate all the Tornado servers here
    upstream frontends {
        server 127.0.0.1:8081;
        server 127.0.0.1:8082;
        server 127.0.0.1:8083;
        server 127.0.0.1:8084;
    }

    include /etc/Nginx/mime.types;
    default_type application/octet-stream;

    access_log /var/log/Nginx/access.log;

    keepalive_timeout 65;
    proxy_read_timeout 200;
    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    gzip on;
    gzip_min_length 1000;
    gzip_proxied any;
    gzip_types text/plain text/html text/css text/xml
               application/x-javascript application/xml
               application/atom+xml text/javascript;

    # Only retry if there was a communication error,not a timeout
    # on the Tornado server (to avoid propagating "queries of death"
    # to all frontends)
    proxy_next_upstream error;

    server {
        listen 8080;

        # Allow file uploads
        client_max_body_size 50M;

        location ^~ /static/ {
            root /var/www;
            if ($query_string) {
                expires max;
            }
        }
        location = /favicon.ico {
            rewrite (.*) /static/favicon.ico;
        }
        location = /robots.txt {
            rewrite (.*) /static/robots.txt;
        }

        location / {
            proxy_pass_header Server;
            proxy_set_header Host $http_host;
            proxy_redirect false;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Scheme $scheme;
            proxy_pass http://frontends;
        }
    }

}
最佳答案
可能有点过期,但如果有人在这里发现了这里的暗示:

可能是配置冲突,请在/ etc / Nginx中检查具有相同指令的.conf文件.

相关文章

Nginx (engine x) 是一个高性能的HTTP和反向代理服务,也是一...
本地项目配置 1 复制 luffy/settings/dev.py为prop.py 修改l...
nginx不仅可以隐藏版本信息,还支持自定义web服务器信息 先看...
一 、此次漏洞分析 1 nginx HTTP/2漏洞 [nginx-announce] ng...
###进入nginx 目录cd /usr/local/nginx###递归显示 2 级目录...
在cmd命令窗口输入下面命令进行查看 tasklist /fi "ima...