I've got nginx working well with Django sites and static content. Now I'm importing some php utilities. There is a folder accessed as http://paulwhippconsulting.com/atwell/ that contains a mix of php, html and javascript files. It is password protected.
I got the password protection working fine and all the files being served but when I add the php location expression to get the php working, strange things happen: I get 403 forbidden for the index.php file and 404 not found for the php and other files.
I've been round the houses trying to set up the right location statement without undue repetition and I got to:
location /atwell/ {
alias /home/paul/atwell;
auth_basic "Please log in";
auth_basic_user_file /home/paul/atwell/htpasswd;
index index.php;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
include fastcgi_params;}}
What am I doing wrong?
I got the password protection working fine and all the files being served but when I add the php location expression to get the php working, strange things happen: I get 403 forbidden for the index.php file and 404 not found for the php and other files.
I've been round the houses trying to set up the right location statement without undue repetition and I got to:
location /atwell/ {
alias /home/paul/atwell;
auth_basic "Please log in";
auth_basic_user_file /home/paul/atwell/htpasswd;
index index.php;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
include fastcgi_params;}}
What am I doing wrong?