How to change the root for testing
Ian Hobson
ian at ianhobson.co.uk
Wed Aug 1 10:30:08 UTC 2012
Hi leki75,
Comments interspersed.
On 30/07/2012 16:19, leki75 wrote:
> 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.
>
> I think this would help you:
>
> map $reseller $reseller_path {
> default /home/ian/websites/coachmaster/htsecure;
> testing /home/ian/websites/coachmaster/testing;
> }
>
> server {
> index index.php index.html index.htm;
> root /home/ian/websites/coachmaster/htsecure;
>
> 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!).
Regards
Ian
>
> location ~ \.php$ {
> fastcgi_pass 127.0.0.1:9000;
> fastcgi_param SCRIPT_FILENAME $reseller_path$fastcgi_script_name;
> fastcgi_param HTTPS ON;
> include /etc/nginx/fastcgi_params;
> }
> }
>
>
--
Ian Hobson
31 Sheerwater, Northampton NN3 5HU,
Tel: 01604 513875
Preparing eBooks for Kindle and ePub formats to give the best reader experience.
More information about the nginx
mailing list