【问题标题】:nginx configuration error: try to open a file which does not exist in sites-enablednginx 配置错误:尝试打开站点启用的文件中不存在的文件
【发布时间】:2021-09-19 07:59:45
【问题描述】:

我尝试检查 nginx 配置

sudo nginx -t

输出:

nginx: [emerg] open() "/etc/nginx/sites-enabled/django1" failed (2: No such file or directory) in /etc/nginx/nginx.conf:60 nginx:配置文件 /etc/nginx/nginx.conf 测试失败

我曾经创建过 django1,但我删除/删除了这个项目。现在我正在尝试开始一个新项目但无法解决此问题。我搜索了很多并试图更改 nginx.conf 文件但没有成功。有谁知道这里出了什么问题? 最好的 亚历克斯

【问题讨论】:

    标签: django nginx


    【解决方案1】:

    您的软链接可能仍然指向您的旧项​​目。 删除 /etc/nginx/sites-enabled/django1 文件/软链接。

    【讨论】:

    • 感谢 Dylan,我刚刚通过使用以下命令重新安装 nginx 解决了这个问题:sudo apt-get purge nginx nginx-common
    猜你喜欢
    • 1970-01-01
    • 2016-03-19
    • 2012-05-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-27
    • 2016-10-15
    相关资源
    最近更新 更多