Forum: NGINX 404 error when adding password protection to directory

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
John T. (Guest)
on 2008-10-07 20:37
Hello i puted proper code into ngix conf for password protection of
directory and when i load protected directory i getting 404 error same
as person on this url:
http://forum.slicehost.com/comments.php?DiscussionID=1609
Any idea why is that happening?Maybe there is needed more lines to be
added?
I have ngix latest stable version on cent os5 installed
Here is how my entire conf file for domain looks:
  server {
  access_log off;

  error_log  logs/vhost-error_log warn;
  listen    80;
  server_name  domain.net www.domain.net;

  # uncomment location below to make nginx serve static files instead of
Apache
  # !WARNING!
  # it will make the bandwidth accounting incorrect as these files won't
be logged!
  #location ~*
\.(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|htm|html|js|css)$ {
  # root   /home/domaindir/public_html;
  #}
location / {
   client_max_body_size    10m;
   client_body_buffer_size 128k;
 location ^~ /st/admin {
            auth_basic "RESTRICTED ACCESS";
            auth_basic_user_file
/home/domaindir/public_html/st/admin/.htpasswd;
        }
   proxy_send_timeout   90;
   proxy_read_timeout   90;

   proxy_buffer_size    4k;
   # you can increase proxy_buffers here to suppress "an upstream
response
   #  is buffered to a temporary file" warning
   proxy_buffers     16 32k;
   proxy_busy_buffers_size 64k;
   proxy_temp_file_write_size 64k;

   proxy_connect_timeout 30s;

   proxy_redirect  http://www.domain.net:81   http://www.domain.net;
   proxy_redirect  http://domain.net:81   http://domain.net;

   proxy_pass   http://ip_adress:81/;

   proxy_set_header   Host   $host;
   proxy_set_header   X-Real-IP  $remote_addr;
   proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
  }
 }
This topic is locked and can not be replied to.