Re: X-Forwarded-For X-Real-IP

Sergey Shepelev temotor gmail.com
10 20:24:49 MSK 2010


2010/1/10 kassern <nginx-forum at nginx.us>:
> !
>
>      -  phpinfo  :
> X-Forwarded-For     83.167.102.xxx
> X-Real-IP    83.167.102.xxx
>    ,   -   IP .       .    .
>

 .        
 X-Host: XXXXX.ru,  PHP      
  ?

X-Real-IP    .
X-Forwared-For     (   )
   .

 , ,      (
)      ?

>
> 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;
>
>    nginx.
>   0.6.39
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?21,39455,39455#msg-39455
>
>
> _______________________________________________
> nginx-ru mailing list
> nginx-ru at nginx.org
> http://nginx.org/mailman/listinfo/nginx-ru
>


nginx-ru