最新消息:20190717 VPS服务器:Vultr新加坡,WordPress主题:大前端D8,统一介绍入口:关于

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

nginx crifan 6863浏览 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,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
75 queries in 0.108 seconds, using 18.95MB memory