0

如何为 DNS 负载平衡和使用 ReST-API 创建我的 /etc/nginx/nginx.conf?但是,负载平衡工作正常。但是创建一个 api 端点并没有像我想象的那样起作用。

当我尝试启动该服务时,它会失败并显示以下错误消息:

“nginx:[emerg] /etc/nginx/nginx.conf:27 中的未知指令“api””。

到目前为止我的配置文件:

stream {
  upstream dns_servers {
    server 127.0.0.2:53 max_fails=3 fail_timeout=30s;
    server 127.0.0.3:53 max_fails=3 fail_timeout=30s;
  }
  server {
    listen 53 udp;
    proxy_pass dns_servers;
  }
}
http {
  server {
    listen 80;
    location /api {
      api write=on;
      allow 127.0.0.1;
      deny  all;
    }
  }
}
4

0 回答 0