Skip to content

Commit 895caaa

Browse files
committed
doc(auth): add example for http basic auth
1 parent 6dbe48c commit 895caaa

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ server [options]
8585
--auth-dir <fs-path> ...
8686
Use Basic Auth for specific file system path.
8787
--user [<username>]:[<password>] ...
88-
Specify users for Basic Auth, empty username and/or password is allowed.
88+
Specify users for current virtual host for Basic Auth, empty username and/or password is allowed.
8989
--user-base64 [<username>]:[<base64-password>] ...
9090
--user-md5 [<username>]:<md5-password> ...
9191
--user-sha1 [<username>]:<sha1-password> ...
@@ -175,6 +175,14 @@ Show access log on console:
175175
server -L -
176176
```
177177

178+
Http Basic Auth:
179+
- requires authentication for url /files
180+
- username: user1, password: pass1
181+
- username: user2, password: pass2
182+
```sh
183+
server --auth /files --user user1:pass1 --user-sha1 user2:8be52126a6fde450a7162a3651d589bb51e9579d
184+
```
185+
178186
Start 2 virtual hosts:
179187
- server 1
180188
- listen on port 80 for http

0 commit comments

Comments
 (0)