# Bug in nginx?

**URL:** <https://www.ruby-forum.com/t/bug-in-nginx/205863>\
**Category:** NGINX\
**Created:** [April 17, 2011, 7:27pm UTC](https://www.ruby-forum.com/t/bug-in-nginx/205863 "2011-04-17T19:27:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [April 17, 2011, 7:27pm UTC](https://www.ruby-forum.com/t/bug-in-nginx/205863/1 "2011-04-17T19:27:49Z")

</div>

Hi,

I’m still using Nginx 0.7.67 and I think I have found a minor bug.

In my config files, for one domain I have entries like this to protect  
two directories.

location /secret {  
index index.html  
auth\_basic “Please login”;  
auth\_basic\_user\_file /path/to/passwordfile  
}

location /private {  
auth\_basic “Hello, Please login”;  
authObasic\_user\_file /path/to/passwordfile;  
if ()  
etc

Note the second line above has no trailing semi-colon.

The result is that /secret is not protected (although /private is).

The bug is that when nginx is restarted, it announces that the config  
file  
is valid, when it isn’t, (so the problem was not detected for many  
months).

Regards

Ian

---

<div class="post-metadata">

**Author:** ![dcian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/91b2a8/32.png) [@dcian](https://www.ruby-forum.com/u/dcian)\
**Post date:** [April 17, 2011, 8:12pm UTC](https://www.ruby-forum.com/t/bug-in-nginx/205863/2 "2011-04-17T20:12:55Z")

</div>

Hello!

On Sun, Apr 17, 2011 at 06:26:56PM +0100, Ian H. wrote:

> Hi,
> 
> I’m still using Nginx 0.7.67 and I think I have found a minor bug.
> 
> In my config files, for one domain I have entries like this to  
> protect two directories.
> 
> location /secret {  
> index index.html  
> auth\_basic “Please login”;

This syntactically correct and defines three possible index files:  
“index.html”, “auth\_basic” and “Please login”.

> auth\_basic\_user\_file /path/to/passwordfile

Note this doesn’t have “;” as well and will make config  
syntactially incorrect. You won’t be able to start nginx such  
config, but I assume this is artifact introduced during writing  
this message.

> The result is that /secret is not protected (although /private is).
> 
> The bug is that when nginx is restarted, it announces that the config file  
> is valid, when it isn’t, (so the problem was not detected for many months).

The problem is that config file is actually valid. It’s not  
really possible to detect such configuration errors as long as  
resulting construct is valid.

Maxim D.

---

<div class="post-metadata">

**Author:** ![dcian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/91b2a8/32.png) [@dcian](https://www.ruby-forum.com/u/dcian)\
**Post date:** [April 17, 2011, 9:36pm UTC](https://www.ruby-forum.com/t/bug-in-nginx/205863/3 "2011-04-17T21:36:56Z")

</div>

On 17/04/2011 19:12, Maxim D. wrote:

> > location /secret {  
> > index index.html  
> > auth\_basic “Please login”;  
> > This syntactically correct and defines three possible index files:  
> > “index.html”, “auth\_basic” and “Please login”.

Hi Maxim,

Your right about that, and the typo later.

Thanks for replying.

Ian

---

<div class="post-metadata">

**Author:** ![dcian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/91b2a8/32.png) [@dcian](https://www.ruby-forum.com/u/dcian)\
**Post date:** [April 18, 2011, 8:36am UTC](https://www.ruby-forum.com/t/bug-in-nginx/205863/4 "2011-04-18T08:36:21Z")

</div>

Ok, but who cares? It’s 1.0 active now.

On 4/17/2011 9:26 PM, Ian H. wrote:

> Hi,
> 
> I’m still using Nginx 0.7.67 and I think I have found a minor bug.

–  
Regards, Vitaly T.  
System A.  
U.S. +1 (206) 905-9939  
Russia +7 911 094-2035
