将 Netdata 连接到 Nginx
启用代理的第一部分是为 Nginx 创建一个新服务器。
使用您喜欢的文本编辑器在 /etc/nginx/sites-available/netdata 创建一个文件,复制以下配置,并更改 server_name 行以匹配您的域。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| upstream backend { server 127.0.0.1:19999; keepalive 64; }
server { listen 80; # uncomment the line if you want nginx to listen on IPv6 address #listen [::]:80;
# Change `example.com` to match your domain name. server_name netdata.example.com;
location / { proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://backend; proxy_http_version 1.1; proxy_pass_request_headers on; proxy_set_header Connection "keep-alive"; proxy_store off; } }
|
参考文章
nginx配置禁特定路径下的反向代理
nginx配置禁止访问目录或禁止访问目录下的文件
nginx跨域处理
带你深入了解nginx基本登录认证(包含配置步骤)
使用htpasswd生成密码
使用openssl生成密码
使用python生成密码
你的nginx登录认证安全吗?
配置http基本验证(Basic Auth)
Centos安装htpasswd_Nginx中使用htpasswd
系列文章