Nginx Load Balancing err 400 - PullRequest
       30

Nginx Load Balancing err 400

0 голосов
/ 30 октября 2018

Может избавиться от этой проблемы. Иметь три nginx 1.14 по одному для балансировки нагрузки два для перенаправления веб-сервера nginx в веб-приложении dotnet. Я использую SSL для балансировки нагрузки. Вот мои настройки:

/etc/nginx/conf.d/load-balancer.conf
upstream backend {
#   least_conn;
   server 172.22.69.102;
   server 172.22.69.103;
}

# This server accepts all traffic to port 80 and passes it to the upstream.
# Notice that the upstream name and the proxy_pass need to match.

server {
   listen 80;
   server_name xxx.ddns.net;
   return 301 https://$server_name$request_uri;

  #location / {
  #    proxy_pass http://backend;
  #}
}

server {
   listen 443 ssl;
   server_name xxx.ddns.net;

   ssl_certificate /etc/nginx/ssl/xxx_ddns_net.crt;
   ssl_certificate_key /etc/nginx/ssl/monserveur.key;

#   error_log /var/log/error.log error;
#  access_log /var/log/acess.log error;

   location / {
        proxy_pass http://backend;
   }
}

На двух nginx я получаю по умолчанию доступный сайт:

server {
#       listen 80 default_server;
        listen 80;

        server_name xxx.ddns.net;

#       error_log /var/log/nginx/error.log;
        error_log /var/log/nginx/error.log debug;

        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                #try_files $uri $uri/ =404;
                proxy_pass http://localhost:5000;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection keep-alive;
                proxy_set_header Host $host;
                proxy_cache_bypass $http_upgrade;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
        }
}

Я получаю http ошибку 400

Любая помощь будет признательна

...