nginx+uwsgi配置出现问题?

发布于 2022-09-07 15:44:36 字数 2927 浏览 22 评论 0

这个是nginx的配置:

server {
    listen 80;
    server_name 127.0.0.1; 
    charset  utf-8;
    index index.html index.htm index.nginx-debian.html;
    client_max_body_size 75M;
    location / {
        include uwsgi_params;
        uwsgi_pass 127.0.0.1:8000;
        uwsgi_param UWSGI_PYTHON /PycharmProjects/Flask/venv;
        uwsgi_param UWSGI_CHDIR /PycharmProjects/Flask;
        uwsgi_param UWSGI_SCRIPT run:app;            
    }
}

这个是uwsgi的配置:

[uwsgi]                                                     
socket = 127.0.0.1:8000                         
plugins = python                                        
chidir = /PycharmProjects/Flask                                   
wsgi-file = app.py                                       
callable = app

输入命令重新启动nginx报错:

root@XULU-PC:/# sudo service nginx start
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.
root@XULU-PC:/#

输入nginx -t提示:

nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied)
2018/06/28 02:13:20 [warn] 5214#5214: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
2018/06/28 02:13:20 [emerg] 5214#5214: open() "/etc/nginx/sites-enabled/nohup.out" failed (13: Permission denied) in /etc/nginx/nginx.conf:62
nginx: configuration file /etc/nginx/nginx.conf test failed

查看nginx.log 提示;

2018/06/28 02:10:14 [emerg] 4960#4960: unexpected end of file, expecting ";" or "}" in /etc/nginx/sites-enabled/nohup.out:2
2018/06/28 02:10:38 [emerg] 4996#4996: unexpected end of file, expecting ";" or "}" in /etc/nginx/sites-enabled/nohup.out:2

输入systemctl status nginx.service错误提示:

root@XULU-PC:/# systemctl status nginx.service
● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: en
   Active: failed (Result: exit-code) since 四 2018-06-28 02:10:38 CST; 2min 1s 
  Process: 4996 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process 

6月 28 02:10:38 XULU-PC systemd[1]: Starting A high performance web server and a
6月 28 02:10:38 XULU-PC nginx[4996]: nginx: [emerg] unexpected end of file, expe
6月 28 02:10:38 XULU-PC nginx[4996]: nginx: configuration file /etc/nginx/nginx.
6月 28 02:10:38 XULU-PC systemd[1]: nginx.service: Control process exited, code=
6月 28 02:10:38 XULU-PC systemd[1]: Failed to start A high performance web serve
6月 28 02:10:38 XULU-PC systemd[1]: nginx.service: Unit entered failed state.
6月 28 02:10:38 XULU-PC systemd[1]: nginx.service: Failed with result 'exit-code
lines 1-12/12 (END)

请问是哪里的问题?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文