VESTACP и Cloudflare настройка
VESTACP и Cloudflare настройка
Я пользуюсь и в логах не вижу реальные адреса посетителей
Знаю, на форуме не раз поднимались разные проблемы с Cloudflare, но не нашел корректного руководства по настройке nginx для VestaCP, чтоб корректно отображалось IP адреса
Знаю, на форуме не раз поднимались разные проблемы с Cloudflare, но не нашел корректного руководства по настройке nginx для VestaCP, чтоб корректно отображалось IP адреса
Re: VESTACP и Cloudflare настройка
any help ?
Re: VESTACP и Cloudflare настройка
если не ошибаюсь это можно в cloudflare настроить
Re: VESTACP и Cloudflare настройка
По моему на сервере нужно, чтоб потом для каждого домена не делать
Re: VESTACP и Cloudflare настройка
В основной конфиг nginx, до инклудов других файлов (т.е. перед # Wildcard include) добавить
ip уточнить здесь https://www.cloudflare.com/ips/
Затем nginx -t (проверяем конфиг). Если все ок, то service nginx restart
Code: Select all
set_real_ip_from 103.21.244.0/22;
set_real_ip_from 103.22.200.0/22;
set_real_ip_from 103.31.4.0/22;
set_real_ip_from 104.16.0.0/12;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 131.0.72.0/22;
set_real_ip_from 141.101.64.0/18;
set_real_ip_from 162.158.0.0/15;
set_real_ip_from 172.64.0.0/13;
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 188.114.96.0/20;
set_real_ip_from 190.93.240.0/20;
set_real_ip_from 197.234.240.0/22;
set_real_ip_from 198.41.128.0/17;
set_real_ip_from 199.27.128.0/21;
set_real_ip_from 2400:cb00::/32;
set_real_ip_from 2606:4700::/32;
set_real_ip_from 2803:f800::/32;
set_real_ip_from 2405:b500::/32;
set_real_ip_from 2405:8100::/32;
set_real_ip_from 2c0f:f248::/32;
set_real_ip_from 2a06:98c0::/29;
# use any of the following two
real_ip_header CF-Connecting-IP;
#real_ip_header X-Forwarded-For;
Затем nginx -t (проверяем конфиг). Если все ок, то service nginx restart
Re: VESTACP и Cloudflare настройка
Спасибо!
То есть других нгниксовских модулей не надо подгружать :)
То есть других нгниксовских модулей не надо подгружать :)
Re: VESTACP и Cloudflare настройка
Не берет :(
# nginx -t
nginx: [emerg] invalid number of arguments in "set_real_ip_from" directive in /etc/nginx/nginx.conf:125
nginx: configuration file /etc/nginx/nginx.conf test failed
# nginx -t
nginx: [emerg] invalid number of arguments in "set_real_ip_from" directive in /etc/nginx/nginx.conf:125
nginx: configuration file /etc/nginx/nginx.conf test failed
Re: VESTACP и Cloudflare настройка
Что в строках 123-127?ars wrote:Не берет :(
# nginx -t
nginx: [emerg] invalid number of arguments in "set_real_ip_from" directive in /etc/nginx/nginx.conf:125
nginx: configuration file /etc/nginx/nginx.conf test failed
Re: VESTACP и Cloudflare настройка
Ничего:
set_real_ip_from 103.21.244.0/22
set_real_ip_from 103.22.200.0/22
set_real_ip_from 103.31.4.0/22
set_real_ip_from 104.16.0.0/12
set_real_ip_from 108.162.192.0/18
set_real_ip_from 131.0.72.0/22
set_real_ip_from 141.101.64.0/18
set_real_ip_from 162.158.0.0/15
set_real_ip_from 172.64.0.0/13
set_real_ip_from 173.245.48.0/20
set_real_ip_from 188.114.96.0/20
set_real_ip_from 190.93.240.0/20
set_real_ip_from 197.234.240.0/22
set_real_ip_from 198.41.128.0/17
set_real_ip_from 199.27.128.0/21
set_real_ip_from 2400:cb00::/32
set_real_ip_from 2405:8100::/32
set_real_ip_from 2405:b500::/32
set_real_ip_from 2606:4700::/32
set_real_ip_from 2803:f800::/32
set_real_ip_from 2c0f:f248::/32
set_real_ip_from 2a06:98c0::/29
123
# use any of the following two
real_ip_header CF-Connecting-IP;
#real_ip_header X-Forwarded-For;
127
set_real_ip_from 103.21.244.0/22
set_real_ip_from 103.22.200.0/22
set_real_ip_from 103.31.4.0/22
set_real_ip_from 104.16.0.0/12
set_real_ip_from 108.162.192.0/18
set_real_ip_from 131.0.72.0/22
set_real_ip_from 141.101.64.0/18
set_real_ip_from 162.158.0.0/15
set_real_ip_from 172.64.0.0/13
set_real_ip_from 173.245.48.0/20
set_real_ip_from 188.114.96.0/20
set_real_ip_from 190.93.240.0/20
set_real_ip_from 197.234.240.0/22
set_real_ip_from 198.41.128.0/17
set_real_ip_from 199.27.128.0/21
set_real_ip_from 2400:cb00::/32
set_real_ip_from 2405:8100::/32
set_real_ip_from 2405:b500::/32
set_real_ip_from 2606:4700::/32
set_real_ip_from 2803:f800::/32
set_real_ip_from 2c0f:f248::/32
set_real_ip_from 2a06:98c0::/29
123
# use any of the following two
real_ip_header CF-Connecting-IP;
#real_ip_header X-Forwarded-For;
127
Re: VESTACP и Cloudflare настройка
Нашел , не хватали ";" :)
Спасибо !
Спасибо !