Tried nginx ML, stackoverflow, and the #nginx IRC channel on freenode to no avail... hoping someone here can help.
My whole nginx conf is here:
http://donsbox.com/~dfelicia/conf/
In
http://donsbox.com/~dfelicia/conf/sites ... nsbox.conf I have:
Code:
location ~ ^/~(.+?)/private(/.*)?$ {
auth_basic "Restricted";
auth_basic_user_file htpasswd;
alias /home/$1/private_html$2;
autoindex on;
}
location ~ ^/~(.+?)(/.*)?$ {
alias /home/$1/public_html$2;
autoindex on;
}
Elsewhere in the same file I have:
Code:
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass phpcgi;
}
So my /~user/ regex is listed before my .php regex and "wins" so that
http://donsbox.com/~dfelicia/ does what I expect. Now I want to be able to run PHP from /~user/, though, and I can't figure out what to add.
i.e. I want this to work:
http://donsbox.com/~dfelicia/test.php
I have tried nesting a location block under the /~user/ location, but no luck.
Any help appreciated.