
运维服务
RocketMQ 5.x 在 Kubernetes 中的集群部署与跨公网 Proxy 接入指南
1. 架构概述 RocketMQ 5.x 采用了存算分离的设计,引入了 Proxy 组件作为计算层,负责协议转换与客户端接入。对于跨公网访问的场景,这带来了一个关键优势:客户端只需
[root@www.wulaoer.org ~]# /usr/local/nginx/sbin/nginx -V nginx version: nginx/1.18.0 built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) built with OpenSSL 1.1.1g 21 Apr 2020 TLS SNI support enabled configure arguments: --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --with-http_gzip_static_module --with-http_sub_module --with-stream --with-stream_ssl_module --with-openssl=/root/lnmp1.7/src/openssl-1.1.1g --with-openssl-opt='enable-weak-ssl-ciphers'如果没有安装,我们可以通过安装的时候nginx的包在重新编译一下即可,编译后
[root@www.wulaoer.org nginx ~]# ./configure --prefix=/usr/local/nginx/ --with-http_realip_module [root@www.wulaoer.org nginx ~]# make && make install编译之后,我们只需要在nginx的配置文件中,给域名加获取用户ip模块。
[root@www.wulaoer.org ~]# vim /usr/local/nginx/conf/nginx.con
server {
listen 80;
server_name www.wulaoer.org;
access_log /var/log/nginx/www.wulaoer.org.access.log main;
error_log /var/log/nginx/www.wulaoer.org.error.log error;
location / {
proxy_pass http://wulaoer;
proxy_set_header Host $host; #添加下面三行
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
include fastcgi_params;
}
}
至此,nginx获取用户的真实ip地址就做完了,这里就不验证了,我这边没有安装,直接获取的。。。。。。
评论 0