最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

[已解决]nginx出错:nginx emerg location directive is not allowed here in

nginx crifan 13185浏览 0评论

折腾:

[记录]尝试去在CentOS中折腾uwsgi

期间,把整个nginx配置改为

    location / { try_files $uri @yourapplication; }
    location @yourapplication {
        include uwsgi_params;
        uwsgi_pass unix:/tmp/uwsgi.sock;
    }

然后再去:

(SIPEvents) ➜  SIPEvents service nginx restart
nginx: [emerg] “location” directive is not allowed here in /etc/nginx/conf.d/default.conf:15
nginx: configuration file /etc/nginx/nginx.conf test failed

搜:

nginx: [emerg] “location” directive is not allowed here in

uwsgi nginx: [emerg] “location” directive is not allowed here in

ubuntu – Standard nginx.conf file is giving errors. Where to include server{} definition? – Stack Overflow

uwsgi – Can’t figure out how to serve static files with Nginx – Stack Overflow

nginx: [emerg] unknown directive “http” – Server Fault

nginx无痛升级并增加nginx-gridfs模块支持 – 奋斗 – 博客频道 – CSDN.NET

用uWSGI替代fastcgi部署django应用 – ichuan.net

改为:

server{
    location / { try_files $uri @app; }
    location @app {
        include uwsgi_params;
        uwsgi_pass unix:/tmp/uwsgi.sock;
    }
}

即可。

转载请注明:在路上 » [已解决]nginx出错:nginx emerg location directive is not allowed here in

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
84 queries in 0.192 seconds, using 22.15MB memory