首页 > 解决方案 > 1#1:此处不允许使用“事件”指令

问题描述

当我启动我的 docker-compose 时,我在控制台中看到了这个。如何解决这个问题? [emerg] 1#1: "events" directive is not allowed here in /etc/nginx/conf.d/nginx.conf:3

nginx.conf

events {}

http {
    server {
        listen 80;


        location / {
            proxy_pass http://kinomonster:8000;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

        location /static/ {
            alias /static/;
        }
    }
}

标签: nginx

解决方案


推荐阅读