a problem about proxy_pass and wordpress

H D public at thuhd.com
Sat Dec 26 09:30:21 MSK 2009


I have a WordPress blog running on nginx+php+mysql platform, on which I run
into a problem related to nginx as a reverse proxy. When I tried to visit
http://www.domain.com/wp-admin/, it would be redirected to
http://www.domain.com/wp-login.php?redirect_to=http://backend/wp-admin/ instead
of
http://www.domain.com/wp-login.php?redirect_to=http://www.domain.com/wp-admin/.
That's to say, the word "backend" in the uri wasn't interpreted to "
www.domain.com". Except this problem, everything seems to go very well. Now
what shoul I do?

Here's my configuration file:
*Reverse Proxy*:
...
location / {
proxy_pass http://backend;
proxy_cache cache;
proxy_cache_key backend$request_uri;
proxy_cache_valid 200 1d;
proxy_cache_use_stale error timeout invalid_header http_500 http_502
http_503 http_504;
}
...
*Backend*:
...
location / {
root   /var/www/;
index  index.php index.html index.htm;
 try_files $uri $uri/ /index.php?q=$uri;    #rewrite rule for WordPress
}
...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20091226/a26aab06/attachment.html>


More information about the nginx mailing list