Hello,
I have a centos 6 server where I would like to have basic authentication of a directory containing a wordpress blog.
my virtual.conf looks like this:
server {
listen 80;
# listen *:80;
server_name myserver.com www.myserver.com;
location / {
root /usr/share/nginx/html/myserver;
index index.html index.htm index.php;
}
location ~ \.php$ {
root /usr/share/nginx/html/myserver;
# fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/tmp/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location /members {
auth_basic "Basic Auth";
auth_basic_user_file "/usr/share/nginx/html/myserver/Zombaio_Data/.htpasswd";
location ~ \.php$ {
#root /usr/share/nginx/html/myserver/members;
# fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/tmp/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
}
when I open the /members It asks for the password and accepts is, but does not open the index.php it sais 404 error
I have a centos 6 server where I would like to have basic authentication of a directory containing a wordpress blog.
my virtual.conf looks like this:
server {
listen 80;
# listen *:80;
server_name myserver.com www.myserver.com;
location / {
root /usr/share/nginx/html/myserver;
index index.html index.htm index.php;
}
location ~ \.php$ {
root /usr/share/nginx/html/myserver;
# fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/tmp/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location /members {
auth_basic "Basic Auth";
auth_basic_user_file "/usr/share/nginx/html/myserver/Zombaio_Data/.htpasswd";
location ~ \.php$ {
#root /usr/share/nginx/html/myserver/members;
# fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/tmp/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
}
when I open the /members It asks for the password and accepts is, but does not open the index.php it sais 404 error