title: Rewrite appended port number via Nginx
body: <p>Hi I use Nginx as Reverse Proxy for Gunicorn and for Apache. Certain Subdomains are getting redirected to Gunicorn and everything else to Apache.
  Also Nginx rewrites all http requests to https requests.</p>
  
  <p>The first call usually works but with every interaction with an Apache-Site the listening port of Apache is added and this breaks my setup.
  Everything non-Apache related works just fine.</p>
  
  <p>What causes this behaviour and how can I fix it? Is it some Apache setting or is my nginx setup wrong?</p>
  
  <pre><code>    # everything to apache
      location / {
              proxy_set_header X-Real-IP $remote_addr;
              proxy_redirect off;
              proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
              proxy_set_header Host $host;
              proxy_pass http://127.0.0.1:8090;
              proxy_set_header X-Nginx-Proxy true;
              }
  </code></pre>
  
  <p>Should I just rewrite every request with :8090 in it? What would the regex look like?</p>