Can't figure out nginx location block problem
My whole nginx conf is here:
In
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:
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
i.e. I want this to work:
I have tried nesting a location block under the /~user/ location, but no luck.
Any help appreciated.