nginx:在/etc/nginx/nginx.conf:1中不允许使用[emerg]“服务器”指令

时间:2019-02-04 13:51:16

标签: nginx uwsgi

我正在尝试在NGINX之后使用uWSGI运行flask应用程序。

这是NGINX的配置。

server {
    location / {
        try_files $uri @app;
    }
    location @app {
        client_body_buffer_size 2M;
        client_max_body_size 2M;
        include uwsgi_params;
        uwsgi_pass unix:///tmp/uwsgi.sock;
        uwsgi_ignore_client_abort on;
    }
    # Configure NGINX to deliver static content from the specified folder
    location /static {
        alias /app/static;
    }
}

但是,在重新启动NGINX时,它会抛出错误:-

nginx: [emerg] "server" directive is not allowed here in /etc/nginx/nginx.conf:1

0 个答案:

没有答案