auth_basic help
-
So I followed the tutorial for restricting folder access, i get the password prompt but then it leads to a 404 error. I checked my log files and it seems its happening because of the folder path:
[error] 1258#0: *1 open() "/usr/local/nginx/html/sitemap/index.php" failed (2: No such file or directory)
for some reason, its thinking my path is /usr/local/nginx/html instead of /home/public_html/mydomain.com/public/
can you help me out here?
Posted 2 years ago # -
OK, I got it to stop giving me the 404 error by adding root path to my location config. But now... instead of loading index.php - it downloads it instead... wtf.
this is what i have:
location ^~ /restricted {
root /home/public_html/mydomain.com/public/;
auth_basic "Restricted Access";
auth_basic_user_file /home/public_html/mydomain.com/public/restricted/.htpasswd;
}Posted 2 years ago # -
osb .. if you're not sorted, post up your vhost and what platform is it for again?
Posted 2 years ago # -
Still haven't figured this out yet.
Here's my vhost: (Ubuntu 8.04LTS, nginx, php-fcgi)
server {
listen 80;
server_name mydomain.com;
rewrite ^/(.*) http://www.mydomain.com/$1 permanent;
}server {
listen 80;
server_name http://www.mydomain.com;
access_log /home/public_html/mydomain.com/log/access.log;
error_log /home/public_html/mydomain.com/log/error.log;location / {
root /home/public_html/mydomain.com/public/;
index index.php index.html;
}location ^~ /restricted {
root /home/public_html/mydomain.com/public/;
auth_basic "Restricted Access";
auth_basic_user_file /home/public_html/mydomain.com/public/restricted/.htpasswd;
index index.php index.html;
}location ~ \.php$
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include /usr/local/nginx/conf/fastcgi_params;
fastcgi_param SCRIPT_FILENAME /home/public_html/mydomain.com/public/$fastcgi_script_name;
}}
Posted 2 years ago #
Reply
You must log in to post.
Want HTML?
a blockquote code em strong ul ol liPlace code between backticks `codeHere`
You've got it.
