Welcome! Log In Create A New Profile

Advanced

Passing request directly to named location

February 11, 2011 05:08AM
Hello all.

I currently have my php set up as so

[code]
...
location ~ \..*/.*\.php$ {
return 403;
}
location ~* ^.+\.php$ {
try_files $uri/fail @proxy;
}
location @proxy {
proxy pass etc
}
location some-location-that-sometimes-needs-rewriting-in-apache-htaccess {
try_files $uri $uri/ @proxy;
}
...
[/code]

Is there a way where when a '.php' file is equested, I just pass the request to the '@proxy' location.

Now I have to use '$uri/fail' (a location that will never be found) so that it will fail and then go to the '@proxy' location.

I see the time spent determining that '$uri/fail' does not exist to be a waste but I can't do 'try_files @proxy' directly.

An option at also works is ...

[code]
...
location ~* ^.+\.php$ {
error_page 403 = @proxy;
return 403;
}
...
[/code]

Just wondering which is more efficient.

Thanks
Subject Author Posted

Passing request directly to named location

Dayo February 11, 2011 05:08AM

Re: Passing request directly to named location

Igor Sysoev February 11, 2011 05:26AM

Re: Passing request directly to named location

Dayo February 11, 2011 06:12AM

Re: Passing request directly to named location

Igor Sysoev February 11, 2011 06:42AM

Re: Passing request directly to named location

Dayo February 11, 2011 07:08AM

Re: Passing request directly to named location

Dayo February 13, 2011 07:50AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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