problems with wp-blog and reverse proxy
July 12, 2010 08:21AM
Hello all,

first of all thanks for looking into this. I have the following problem.

Wordpress is running on a dedicated server only for wordpress out application is running on other application servers. to handle the load we have also a load balancer working. To deliver the load as fast as possible we deliver static content directly via the lb (nginx). Here my question:

1) the load balancer gets the request
2a) if its static conent is delivers it directly
2b) if its application relevant it forwards the request to the tomcats on the application servers
2c) if its blog content (location /blog) nginx get the blog information via proxy pass from the dedicated blog server.

My Problem is now that in case of 2c) i dont want to deliver the static content from the load balancer directly (because its not there).. for all /blog/ content nginx should get ALL data via proxy_pass from wordpress..

Any ideas?

here is my current server configuration for nginx (that is not working for /blog/ :) :

[CODE]


if ($request_uri ~* "/blog/") {
location ~* ^.+.(jpg|jpeg|gif|png|ico|zip|tgz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
access_log off;
expires max;
root /var/www/static;
}


location ~* ^.+.(css|txt|js)$ {
access_log off;
expires 15d;
root /var/www/static;
}
}
location /blog/ {
# If logged in, don't cache.
if ($http_cookie ~* "comment_author_|wordpress_(?!test_cookie)|wp-postpass_" ) {
set $do_not_cache 1;
}
proxy_cache_key "$scheme://$host$request_uri $do_not_cache";

proxy_pass_header Set-Cookie;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

sub_filter_once off;
sub_filter 'subdomainForBlog' 'MainDomain/blog';
proxy_pass http://subdomainForBlog;

}

[/CODE]
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 202
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