title: how to set up nginx as reverse proxy (bastion); i have "400Bad Request: too many Host headers"
body: <p>I try to set up nginx to authenticate incoming https request and pass them on to a server on a different host in the same intranet (LAN). from different sources i arrived at the following conf file:</p>
  
  <pre><code>    proxy_redirect              off;
      proxy_set_header            Host            $http_host;
      proxy_set_header            X-Real-IP       $remote_addr;
      proxy_set_header            X-Forwared-For  proxy_add_x_forwarded_for;
  
  upstream syncthing_gui 
    {
        server 10.0.0.129:8329; 
    }
  
  server {
    listen       443 ssl;
    server_name  geras.duckdns.org;
  
      ssl    on;
      ssl_certificate    /etc/letsencrypt/live/geras.duckdns.org/fullchain.pem;
      ssl_certificate_key    /etc/letsencrypt/live/geras.duckdns.org/privkey.pem;
  
      auth_basic "Username and Password required (syncthing)";
      auth_basic_user_file /etc/nginx/.htpasswd;
  
    location /sync {
  
      error_log /var/log/nginx/error.log info; 
      access_log /var/log/access.log;
      proxy_pass http://syncthing_gui;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>but i get the error <code>400 Bad Request: too many Host headers</code>. what do i have to change?</p>