
nginx: [emerg] unknown directive "set_real_ip_from"的解决方法
出现nginx: [emerg] unknown directive "set_real_ip_from"
是因为nginx缺少了realip模块
重新添加realip模块编译即可。。。
1
2
3
4
5
6
7
8
9
10
11
12
./configure --prefix=/usr/local/nginx --user=www-data --group=www-data --pid-path=/var/run/ginx.pid \
--with-http_ssl_module \
--with-http_v2_module \
--with-http_v3_module \
--with-http_stub_status_module \
--with-http_gzip_static_module \
--with-http_realip_module \
--add-module=/opt/ngx_brotli \
--with-openssl=../quiche/deps/boringssl \
--with-quiche=../quiche \
--with-pcre=/opt/pcre-8.44 \
--with-zlib=/opt/zlib-1.2.11
记得添加--with-http_realip_module
模块
如果nginx已经上线,只需要执行make
即可,然后备份旧的nginx进程文件,
把编译好新的nginx二进制文件复制到nginx安装sbin目录下即可
💘 相关文章
- nginx: [emerg] Solution to unknown directive "set_real_ip_from"
- 一款可视化适合小白的cdn构建系统
- how to do config nginx allow's cloudflare ip's
- 使用301实现域名跳转到www包括https的3种方法
- Nginx使用Memcached缓存加速wordpress,秒开网站
- nginx打上QUIC补丁,抢先体验http3
- 比较简单实用高效的网站防止灌水和反爬虫方案
- 不知道是不是错觉,感觉caddy 比nginx快
- nginx: [warn] "ssl_stapling" ignored, not supported告警
- Nginx – Unit nginx.service is masked的解决方法