Welcome! Log In Create A New Profile

Advanced

Re: How to change the root for testing

Francis Daly
August 01, 2012 02:46PM
On Wed, Aug 01, 2012 at 11:30:08AM +0100, Ian Hobson wrote:
> On 30/07/2012 16:19, leki75 wrote:

Hi there,

> >Do you mean that requesting /testing/something.php tries to use
> >/home/ian/websites/coachmaster/htsecure/something.php instead of
> >/home/ian/websites/coachmaster/testing/something.php?
> Yes, Exactly.

> >In the regexp location the document_root is inherited from the server
> >context.
> I expected that to be replaced as the location is more specific. Oh well.

One request is handled by one location.

You have the location definitions:

location /testing {}
location ~ \.php$ {}

Per the docs (http://nginx.org/r/location), the request for
/testing/something.php is handled by the second location there.

What you want is some way of setting "fastcgi_param SCRIPT_FILENAME"
to point to the testing filename, when appropriate.

Probably the least-impact way of doing this would be to add a new

location ~ ^/testing/.*php$ {}

with the same content as your current php location, plus the root
directive that you want. There are other ways of doing this too.

> >rewrite ^/(?<reseller>kaleidoscope|chat|Spanish|3MCoach|testing)(.*)$
> >$2?rs=$reseller last;
> I don't understand what the ?<reseller> bit is doing. (and Google has
> been no help!).

It's a perl-compatible regex named capture. Older pcre libraries may
not recognise the syntax, in which case you should see a clear warning
to that effect.

All the best,

f
--
Francis Daly francis@daoine.org

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

How to change the root for testing

hobson42 July 29, 2012 04:16AM

Re: How to change the root for testing

leki75 July 30, 2012 11:19AM

Re: How to change the root for testing

hobson42 August 01, 2012 06:32AM

Re: How to change the root for testing

Francis Daly August 01, 2012 02:46PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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