【问题标题】:Nginx config file not reloadingNginx 配置文件未重新加载
【发布时间】:2020-11-09 22:15:14
【问题描述】:

我正在尝试涉足 Nginx 并制作我的第一台服务器,但它不起作用。这是我的配置文件

worker_processes  1;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;
    keepalive_timeout  65;

    server {
        location / {
            root ~/42cursus/ft_server/tests/www;
        }

        location /images/ {
            root ~/42cursus/ft_server/tests;
        }
    }
    include servers/*;
}

我一直在关注这个初学者指南:https://nginx.org/en/docs/beginners_guide.html。我唯一不同的是删除默认配置文件中的注释行,以便对我更清楚。

每当我发送 nginx -s reload 时,我的 error.log 中都会添加一个“信号进程已启动”,并且尝试通过 localhost 访问该站点时只会显示 This

有人可以帮助我吗,请记住我在学校的计算机上并且不能使用 SUDO ?提前谢谢你。

【问题讨论】:

    标签: nginx nginx-config


    【解决方案1】:

    添加了“听 80;”到我的服务器块,现在我得到一个 404 而不是什么都没有,至少这是进步!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-02-13
      • 1970-01-01
      • 1970-01-01
      • 2011-01-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多