Skip to content

Commit dcf0a25

Browse files
author
zhang
committed
Prometheus
1 parent bdce133 commit dcf0a25

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

markdown-file/Nginx-Install-And-Settings.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,27 @@ upgrade:
310310
- 更新 `make upgrade`
311311

312312

313+
## 为 Nginx 添加 basic_auth
314+
315+
```
316+
yum install httpd-tools
317+
318+
htpasswd -c /opt/nginx-auth/passwd.db myusername,回车之后输入两次密码
319+
320+
321+
server {
322+
...
323+
324+
location / {
325+
auth_basic "please input you user name and password";
326+
auth_basic_user_file /opt/nginx-auth/passwd.db;
327+
....
328+
}
329+
}
330+
331+
```
332+
333+
313334
## Nginx 全局变量
314335

315336
- $arg_PARAMETER #这个变量包含GET请求中,如果有变量PARAMETER时的值。

0 commit comments

Comments
 (0)