title: nginx loadbalancer and OAuth
body: <p>I'm trying to set up a nginx loadbalancer/proxy for two servers, with OAuth authenticated apps running on both of them.
  Everything's running fine when nginx is running on port 80, but when I put it on any other port OAuth authentication fails with an "invalid signature" error message.</p>
  
  <p>Here is my server config in nginx.conf:</p>
  
  <pre><code>server {
      listen 80;
      server_name localhost;
      location / {
        proxy_pass  http://webservice;
  
          proxy_set_header        Host            $host;
          proxy_set_header        X-Real-IP       $remote_addr;
          proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header        X-Forwarded-Port $server_port;
          proxy_set_header        X-Forwarded-Host $host;
          proxy_set_header        X-FORWARDED-PROTO https;
      }
  </code></pre>
  
  <p>Has anyone run into a similar problem?</p>
  
  <p>PS: I've noticed that the port 80 is omitted from the OAuth realm property, but other ports are added normally.</p>