Welcome! Log In Create A New Profile

Advanced

a problem about proxy_pass and wordpress

December 29, 2009 12:42PM
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
}
....
_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

a problem about proxy_pass and wordpress

HD@THU December 29, 2009 12:42PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 263
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready