Настройте HttpRealIpModule для nginx

Настройте HttpRealIpModule для nginx

Я хочу добавить Cloudflare на сервер, который я получу через несколько дней. Однако, чтобы сохранить IP моих посетителей, мне придется установить модуль HttpRealIpModule согласно вики Cloudflare -- https://www.cloudflare.com/wiki/Nginx

Я использую эти репозитории EPEL,

rpm --import https://fedoraproject.org/static/0608B895.txt
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm
rpm --import http://rpms.famillecollet.com/RPM-GPG-KEY-remi 
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
yum install yum-priorities

а потом

yum install nginx 

У меня два вопроса:

  1. Будут ли они автоматически устанавливать HttpRealIpModule?
  2. Если нет, как мне установить его с помощью этих репозиториев EPEL?

решение1

Версия nginx, представленная в репозитории remi, уже включает HttpRealIpModule. Вам нужно только yum install nginx.

Проверить, с помощью чего был скомпилирован nginx, можно с помощью nginx -V:

nginx version: nginx/1.0.15
built by gcc 4.4.6 20110731 (Red Hat 4.4.6-3) (GCC) 
TLS SNI support enabled
configure arguments: --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/var/run/nginx.pid --lock-path=/var/lock/subsys/nginx --user=nginx --group=nginx --with-file-aio --with-ipv6 --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module --with-http_image_filter_module --with-http_geoip_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_stub_status_module --with-http_perl_module --with-mail --with-mail_ssl_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --with-ld-opt=-Wl,-E

Связанный контент