forked from fukusaka/nginx-http-auth-digest
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Depends on: http://mailman.nginx.org/pipermail/nginx-devel/2015-August/007209.html Fixes: #1 and samizdatco#22
- Loading branch information
1 parent
0df6534
commit 095175a
Showing
5 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
test:test:aeeebbfd75d1499d24388f5b9b10e0ef |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# | ||
|
||
worker_processes 8; | ||
worker_rlimit_nofile 512; | ||
|
||
pid test.pid; | ||
daemon off; | ||
|
||
error_log /dev/stdout crit; | ||
|
||
events { | ||
worker_connections 512; | ||
multi_accept on; | ||
use epoll; | ||
} | ||
|
||
http { | ||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
|
||
access_log /dev/stdout; | ||
access_log off; | ||
|
||
server { | ||
listen 127.0.0.1:9090; | ||
server_name example.com; | ||
|
||
auth_digest_user_file .htdigest; | ||
|
||
location /remote_user_set { | ||
auth_digest 'test'; | ||
echo "remote_user: $remote_user"; | ||
} | ||
location /remote_user_unset { | ||
echo "remote_user: $remote_user"; | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
|
||
$NGINX -p $PWD -c server.conf & | ||
sleep 1 | ||
|
||
curl -s -S -H "Host: example.com" --digest -u "test:test" "http://127.0.0.1:9090/remote_user_set" | ||
curl -s -S -H "Host: example.com" --digest -u "test:test" "http://127.0.0.1:9090/remote_user_unset" | ||
curl -s -S -H "Host: example.com" "http://127.0.0.1:9090/remote_user_unset" | ||
|
||
kill `cat test.pid` | ||
sleep 1 |