nginx

nginx 安装rtmp模块实现推流服务器

安装模块 请移步 https://www.cuiwei.net/p/1011052604 配置文档 https://github.com/arut/nginx-rtmp-module/wiki/Directives vi /etc/nginx/nginx.conf load_module modules/ngx_rtmp_module.so; events { worker_connections 1024; } rtmp { server { listen 1935; chunk_size 4096; applicatio...

nginx 安装第三方模块

下面以rtmp模块为例 https://github.com/arut/nginx-rtmp-module 普通方式 静态模块 ./configure --add-module=/path/to/nginx-rtmp-module make //make编译,编译好的程序在objs文件夹下面,这时候不要执行make install 避免新编译的程序有问题,又覆盖了原有的程序 //备份原来的nginx可执行文件 mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.old //把编译好的Nginx程序替换到原来的目录里 cp...

docker nginx反向代理 nginx-proxy

我们知道nginx本身是有 反向代理 功能的,下面介绍的nginx-proxy是 docker 场景下,不用写传统的反向代理配置,即可实现 反向代理的效果 下面来看一个docker-compose.yml version: '3' networks: web-network: services: docker-nginx: image: nginx:1.21.3 restart: always environment: - VIRTUAL_PORT=80 - VIRTUAL_HOST=whoami.local,192.168.10.4...

使用 acme.sh 生成免费的 https 证书

可以从 zerossl 生成免费的证书,有效期90天 安装 curl https://get.acme.sh | sh -s email=你的email 如上,是最简单的安装方法,但可能不会成功(因为这个域名访问不了raw.githubusercontent.com),最稳妥的方法是下面这种 git clone https://github.com/acmesh-official/acme.sh.git cd acme.sh [root@iZbp1430s16l9piu268n8rZ acme.sh]# ./acme.sh --install -m 你的email [Fri Apr 8 19...

rsyslog 收集 nginx 日志到专门的日志服务器

当然,你可以使用filebeat, logstash, fluentd等,但相比之下rsyslog是系统自带的,资源占用低 第一种方法,配置 nginx https://nginx.org/en/docs/syslog.html vi /etc/nginx/nginx.conf # access_log /var/log/nginx/access.log main; access_log syslog:server=logstash:514,facility=local7,tag=nginx_access_log,severity=info; error_log s...

Grafana nginx日志仪表盘

本文主要介绍一款nginx 日志仪表盘 —— AKA ES Nginx Logs,非常的酷炫,基于Grafana 先看下效果 docker-compose https://github.com/chudaozhe/grafana-dashboard-nginx-logs Grafana 设置 http://localhost:3000/ admin admin 设置es数据源 导入仪表盘 Grafana 插件 安装两个插件 找到仪表盘,看效果

nginx 编译安装

下面以CentOS为例 编译安装 下载 wget https://ftp.pcre.org/pub/pcre/pcre-8.44.tar.gz wget http://nginx.org/download/nginx-1.20.0.tar.gz 编译 # 创建所属用户和组,不创建家目录,不能ssh登录 useradd -M -s /sbin/nologin www ./configure --user=www --group=www --prefix=/data/apps/nginx --conf-path=/vagrant/apps/nginx/conf/nginx.conf --pid-...