title: Nginx is forwarding to apache2, but the user get url with :3000
body: <p>After setting apache2 to listen on port 3000 and server php files(wordpress) hitting blog.mysite.com:3000 loads my wordpress install no problem. Then I set up nginx listening on port 80 as a proxy to apache. This is working fine, my only issue is that when users hit blog.mysite.com, its get redirected to blog.mysite.com:3000 instead and this is not the desired behavior. Looked online for a few solutions involving adding some php code to my wp-config.php but didnt worked. Any help with this?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <pre><code>server {
          listen       80 default_server;
          server_name  appsrd.devmbs.com;
          root /home/ubuntu/projecs/APPS-RD;
          #charset koi8-r;
  
          #access_log  logs/host.access.log  main;
  
          location / {
              root   /home/ubuntu/projects/APPS-RD;
              index  index.html index.htm index.php;
          }
  
          error_page   500 502 503 504  /50x.html;
          location = /50x.html {
              root   html;
          }
  
          location ~ \.php$ {
          proxy_pass   http://127.0.0.1:3000;
          proxy_buffering on;
          proxy_buffers 12 12k;
          proxy_redirect off;
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header Host $host;
          proxy_redirect  http://appsrd.devmbs.com:3000   http://appsrd.devmbs.com;
  
          }
  }
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>/wp-admin is being displayed but the root of the site, is ging in a redirected loop.</p>
  
  <p>127.0.0.1 - - [03/Sep/2012:12:29:25 +0000] "GET /index.php HTTP/1.0" 301 529 "http://appsrd.devmbs.com/wp-admin/options-general.php" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_0) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1"</p>
  
  <p>This request is getting fired like 12 to 15 times.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Weirdest thing, I deleted the database and went into <a href="http://www.mysite.com" rel="nofollow">http://www.mysite.com</a>, and the redirect loop was gone, I got a msg that wordpress couldn't find a DB which was supposed to happens. Then I created a new database, ran the wordpress install and the same arises. The admin works fine but the site page gets redirect loop.</p>