Forum: NGINX 404 error when adding password protection to directory

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
D98ae985593bde7ba62f114b49181709?d=identicon&s=25 John Travolota (roguehosting)
on 2008-10-07 18: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:
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;

  # 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_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.