404 error when adding password protection to directory

John Travolta lists at ruby-forum.com
Tue Oct 7 20:37:17 MSD 2008

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:
Any idea why is that happening?Maybe there is needed more lines to be
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
  # 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";
   proxy_send_timeout   90;
   proxy_read_timeout   90;

   proxy_buffer_size    4k;
   # you can increase proxy_buffers here to suppress "an upstream
   #  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;
Posted via http://www.ruby-forum.com/.

More information about the nginx mailing list