How to change the root for testing

leki75 nginx-forum at nginx.us
Mon Jul 30 15:19:25 UTC 2012


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?

In the regexp location the document_root is inherited from the server
context. 

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;

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;
}
}

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,229067,229097#msg-229097



More information about the nginx mailing list