如何将NGINX配置为http负载均衡器

时间:2020-05-17 18:03:03

标签: nginx nginx-reverse-proxy nginx-config

我在Windows上使用1.18版本。 我试图将NGINX配置为负载平衡器。我看了看文档,但仍然没用。 (https://www.nginx.com/resources/wiki/start/topics/examples/loadbalanceexample/

这是我要由负载均衡器转发的本地URL

http://localhost:57879/swagger/index.html

这是我的配置

events { }
http {
  upstream myproject {
    server localhost:57879 weight=3;
  }

  server {
    listen 80;
    server_name _;

    location /swagger {
      proxy_pass http://myproject;
    }
  }
}

0 个答案:

没有答案