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?
EDIT:
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;
}
}
EDIT:
/wp-admin is being displayed but the root of the site, is ging in a redirected loop.
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”
This request is getting fired like 12 to 15 times.
EDIT:
Weirdest thing, I deleted the database and went into http://www.mysite.com, 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.
Issue was that in the wordpress setting I had wrong Address so it was adding :3000 at the end of the url. Since the title of this question no longer represent my current issue I will close it and create a new question.