title: Configure NextCloud & Nginx Reverse Port Forward - Login Authentication Error
body: <p>I have set up an nginx reverse proxy server on my web server, which is receiving SSL traffic, and reverse proxying it to port 8080 on my web server, which is an exposed port running the nextcloud docker image. I am able to log in from a desktop web browser, but I am not able to log in from my iPhone. When I log in from the app, I receive error message "Access Forbidden, Invalid Request." <a href="https://github.com/nextcloud/server/issues/8956" rel="nofollow noreferrer">This</a> Github issue identifies the issue as auth headers being removed from the request, though the solution it gives is for Apache, not for Nginx. I'm really not familiar with authorization headers. How would I modify my Nginx server directive to take care of the issue?</p>
  
  <p><strong>Current setup</strong></p>
  
  <pre><code>server {
      listen 443 ssl;
      listen [::]:443 ssl;
  
      server_name cloud.foo.com;
  
      ssl_certificate /etc/letsencrypt/live/cloud.foo.com/fullchain.pem; # managed by Certbot
      ssl_certificate_key /etc/letsencrypt/live/cloud.foo.com/privkey.pem; # managed by Certbot
      include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
      ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
  
      location / {
          proxy_pass         http://127.0.0.1:8080/;
  
          proxy_set_header   X-Real-IP        $remote_addr;
          proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
          proxy_set_header   Host             $host;
      }
  }
  </code></pre>