Welcome! Log In Create A New Profile

Advanced

X-Forwarded-For и X-Real-IP совпадают

January 10, 2010 11:11AM
Здравствуйте!

У меня возникла такая проблема - в phpinfo выводится следующее:
X-Forwarded-For 83.167.102.xxx
X-Real-IP 83.167.102.xxx
То есть и там, и там - два одинаковых IP адреса. Это не дает нормально посчитать посещения сайта. Причем указывается адрес пользователя.

[code]
user nginx;
worker_processes 1;

error_log /var/log/nginx/error.log;
#error_log /var/log/nginx/error.log notice;
#error_log /var/log/nginx/error.log info;

pid /var/run/nginx.pid;



#----------------------------------------------------------------------
# Events Module
#
# http://wiki.codemongers.com/NginxEventsModule
#
#----------------------------------------------------------------------

events {
worker_connections 1024;
}


#----------------------------------------------------------------------
# HTTP Core Module
#
# http://wiki.codemongers.com/NginxHttpCoreModule
#
#----------------------------------------------------------------------

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] $request '
'"$status" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 65;

#gzip on;

# Load config files from the /etc/nginx/conf.d directory
include /etc/nginx/conf.d/*.conf;

#
# The default server
#
client_max_body_size 16m;
server {
listen 188.72.226.197:80;
server_name XXXXX.ru www.XXXXX.ru hosting.XXXXX.ru www.hosting.XXXXX.ru;
rewrite ^(/manager/.*)$ https://$host$1 permanent;
location ~* ^/(webstat/|awstats|webmail/|myadmin/|manimg/) {
proxy_pass http://188.72.226.197:8080;
proxy_redirect http://XXXXX.ru:8080/ /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
location / {
proxy_pass http://188.72.226.197:8080;
proxy_redirect http://XXXXX.ru:8080/ /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar)$ {
root /var/www/XXXXX/data/www/XXXXX.ru;
access_log /var/www/httpd-logs/XXXXX.ru.access.log;
error_page 404 = @fallback;
[/code]
Это мой конфиг nginx.
Использую версию 0.6.39
Subject Author Posted

X-Forwarded-For и X-Real-IP совпадают

kassern January 10, 2010 11:11AM

Re: X-Forwarded-For и X-Real-IP совпадают

Sergey Shepelev January 10, 2010 12:26PM

Re: X-Forwarded-For и X-Real-IP совпадают

proforg January 10, 2010 12:44PM

Re[2]: X-Forwarded-For и X-Real-IP совпадают

akalend January 11, 2010 02:44AM

Re: Re[2]: X-Forwarded-For и X-Real-IP совпадают

proforg January 11, 2010 03:12AM

Re[4]: X-Forwarded-For и X-Real-IP совпадают

akalend January 11, 2010 05:54AM

Re: X-Forwarded-For и X-Real-IP совпадают

Pavel V. January 10, 2010 12:52PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 111
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready