0.7.19 && $server_addr

Vladimir Yeshchenko des at a.ua
Fri Oct 17 15:20:31 MSD 2008


Здравствуйте!
Собрал 0.7.19 в FreeBSD 6.2-RELEASE-p9.
Что-то не то с переменной $server_addr или я не умею ее использовать.
1. в логе вместо $server_addr пусто.
2. в заголовке X-Proxy-IP тоже пусто.

user  nobody;
worker_processes  6;

error_log  /usr/local/www/nginx/logs/error.log;

events {
    worker_connections  2048;
}

http {
    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" 
"$http_host" "$server_addr"';

        sendfile        on;

        keepalive_timeout  0;
        ignore_invalid_headers on;
        large_client_header_buffers 8 32k;

        upstream  backend  {
             server   89.18.189.xx:80;
        }

    server {
        listen          85.12.43.xx:80;
        listen          85.12.43.xx:80;

        server_name  localhost;
        access_log  /usr/local/www/nginx/logs/85.12.43.xx/access.log main;

        location / {
            proxy_pass                          http://backend;
            proxy_set_header                    X-Real-IP $remote_addr;
            proxy_set_header                    X-Proxy-IP $server_addr;
            proxy_pass_request_headers          On;
            client_max_body_size                10m;
            client_body_buffer_size             128k;
            proxy_connect_timeout               10;
        }
    }
}





More information about the nginx-ru mailing list