Welcome! Log In Create A New Profile

Advanced

Re: Not sure if it's passing to the proxy properly

Maxim Dounin
February 05, 2010 05:00AM
Hello!

On Fri, Feb 05, 2010 at 12:35:45PM +0300, Igor Sysoev wrote:

> On Fri, Feb 05, 2010 at 12:30:12PM +0300, Maxim Dounin wrote:
>
> > Hello!
> >
> > On Fri, Feb 05, 2010 at 02:43:58AM -0500, James Matthews wrote:
> >
> > > Hi,
> > >
> > > I am passing my requests like this
> > > if ( -f $request_filename){
> > > expires 30d;
> > > break;
> > > }
> > > proxy_pass http://127.0.0.1:20000;
> > >
> > > However Apache is still serving everything (images included). How can I get
> > > it to move only through nginx (for images and other files).
> >
> > Try this:
> >
> > location / {
> > try_files $uri @fallback;
> > expires 30d;
> > }
> >
> > location @fallback {
> > proxy_pass http://127.0.0.1:20000;
> > }
>
> And do not forget about "root". Probably this was a cause why
>
> if (-f $request_filename) {
>
> did not work. However, anyway you should use try_files instead of "if".

In the original config proxy_pass is configured at location level,
and "if" won't "de-configure" it (r->content_handler will be set at
location level, and will be used inside implicit location created
by "if").

There is nothing wrong in original config, it works as expected.
It just doesn't prevent proxy_pass from executing.

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Not sure if it's passing to the proxy properly

James Matthews February 05, 2010 02:48AM

Re: Not sure if it's passing to the proxy properly

Maxim Dounin February 05, 2010 04:34AM

Re: Not sure if it's passing to the proxy properly

Igor Sysoev February 05, 2010 04:38AM

Re: Not sure if it's passing to the proxy properly

Maxim Dounin February 05, 2010 05:00AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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