Welcome! Log In Create A New Profile

Advanced

Re: Location not called properly

Francis Daly
October 24, 2011 04:14PM
On Mon, Oct 24, 2011 at 07:02:35AM -0400, TECK wrote:

Hi there,

> The fastcgi value is the name of my upstream.

Yes, that part works.

> The idea is: once the location /somedir/file1.php is reached,
> everything in @cache should execute.

If you *really* want to do it that way, it would be something like

try_files /no-such-file @cache;

But you probably don't want to do it that way.

> In this way, I don't repeat several times the same code.

If you don't want to *see* lots of repetition in nginx.conf, use
"include".

If you don't want to *write* lots of repetition in nginx.conf, use a
separate generator to create it.

> This works:
>
> location /somedir/file1.php {

This will match "/somedir/file1.php", and "/somedir/file1.phpX", and
"/somedir/file1.php/X", for any X.

Although later config will likely block anything except
"/somedir/file1.php" from being processed.

> This does not:
> location = /somedir/file1.php {

This will match only "/somedir/file1.php".

> try_files @cache =404;

This will serve the file "/usr/local/nginx/html@cache", or else
return 404. (try_files tries files. Only the last parameter is handled
specially.)

Either make it "try_files /no-such-file @cache;", or replace it with
"include my-repeated-php-config-file;"

Good luck,

f
--
Francis Daly francis@daoine.org

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

Location not called properly

TECK October 23, 2011 04:13PM

Re: Location not called properly

Francis Daly October 23, 2011 07:34PM

Re: Location not called properly

TECK October 24, 2011 07:02AM

Re: Location not called properly

Francis Daly October 24, 2011 04:14PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 73
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready