Welcome! Log In Create A New Profile

Advanced

Re: Set a particular location for address starting with '?'

September 24, 2009 11:12AM
On Thu, 2009-09-24 at 09:30 -0400, mvip wrote:
> Cliff,
>
> Thanks for taking the time to answer my post. Unfortunately that
> didn't do the trick.
>
> Let me try to explain the situation a bit better. I'm using Nginx as a
> load balancer to proxy two different apps sitting on the same domain:
> one Django app and one wordpress blog. I want to proxy '/' and
> '/folder1' to the django server and /?.* as well as everything else to
> the wordpress server.
>
> My current setup is as follows:
> location / { proxy_pass http://blog.foobar.com;}
> location = / {proxy_pass http://www.foobar.com; }
> location ~ /admin/.* {proxy_pass http://www.foobar.com; }
> location ~ /folder1/.* {proxy_pass http://www.foobar.com; }
>
> It works great with the exception of that I cannot seem to filter out
> all the /?.* calls.
>
> What do you think is the best approach for this problem?

Try this:

location / {
if ($is_args) {
proxy_pass http://blog.foobar.com; # wordpress
}
proxy_pass http://www.foobar.com; # django
}

However, what would make a lot more sense is to setup wordpress as
either a subdomain or under /blog or something. Then you could just
have a separate server section or location.

Regards,
Cliff
Subject Author Posted

Set a particular location for address starting with '?'

mvip September 23, 2009 07:38PM

Re: Set a particular location for address starting with '?'

Cliff Wells September 23, 2009 09:36PM

Re: Set a particular location for address starting with '?'

mvip September 24, 2009 09:30AM

Re: Set a particular location for address starting with '?'

mvip September 24, 2009 12:22PM

Re: Set a particular location for address starting with '?'

Cliff Wells September 24, 2009 11:12AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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