Auth Digest in Nginx

I've just setup nginx and testing the config file nginx.conf with:

Code:
nginx -t

is giving:

Code:
nginx: [emerg] unknown directive "auth_digest_user_file" in /usr/local/etc/nginx/nginx.conf:54
nginx: configuration file /usr/local/etc/nginx/nginx.conf test failed

I have the file in the directory with path pointing to it in nginx.conf as per the doc's:

http://wiki.nginx.org/HttpAuthDigestModule

and I've had no problem getting htdigest working in apache.

I've had to deinstall/reinstall nginx to add the auth_digest module, and when I make config - it's selected - so it appears to be installed.

This is what I have:

Code:
auth_digest_user_file /usr/local/www/passwd.digest;
        location /private{
        auth_digest 'These aren't the files you're looking for.';
        }

Any thoughts on why digest auth may not be working?
 
There are 4 ' in that line, there should be only 2, at the beginning and at the end, or at least backslash the inner ones like that:

auth_digest 'These aren\'t the files you\'re looking for.';

... or use 'longer' version:
auth_digest 'These are not the files you are looking for.';
 
  • Thanks
Reactions: nx
Hello,

When installing nginx from ports you should build with auth digest support, i.e. mark HTTP_AUTH_DIGEST, because by default is not built.
Also from the page you followed it is written that:

ngx_http_auth_digest - HTTP Digest Authentication support for Nginx.

This module is not distributed with the Nginx source.
 
  • Thanks
Reactions: nx
Thanks vermaden, I tried that but it doesn't fix it.

Duh! Thanks quintessence... I don't know how I missed that.
Code:
nginx -V

doesn't show the auth_digest module... but it also doesn't show the rewrite module which I had to install for php, and before I reinstalled nginx with it, the config complained it was missing.
That's my excuse for missing the install instructions! ;)

I'll follow them now.

Thanks!
 
Back
Top