iT邦幫忙

0

Nginx取得使用者真實IP到後台伺服器

這應該是最後個問題了 這問題解決了大致上新版點播系統就差不多完成了
目前location設定是這樣(已改用有啟用http_realip_module的opentesty)

        location / {
			proxy_pass http://ac1011.hopto.org;
			proxy_redirect off; 
            proxy_set_header Host $host:$server_port;  
            proxy_set_header X-Real-IP $remote_addr;  
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            set_real_ip_from  111.243.160.197;
			real_ip_header    X-Real-IP;
            real_ip_recursive on;
			expires max;
        }

可是即便我這樣兩種方法都設了後台的foobar還是無法取得使用者的真實IP
都是用我的IP點播.......要怎樣才能讓foobar取得使用者的真實IP?

目前是只有一級反向 就是:niginx反向->後方真實伺服器
還是需要再用原版nginx架設二級反向?

froce iT邦大師 1 級 ‧ 2019-07-08 10:14:50 檢舉
你是要foobar得到 real ip?
不是nginx得到?
恩 要不然就用第二台nginx取得real ip丟foobar
檢查了下發現這行:nginx: [warn] could not build optimal proxy_headers_hash, you should increase either proxy_headers_hash_max_size: 512 or proxy_headers_hash_bucket_size: 64; ignoring proxy_headers_hash_bucket_size
修正了可是foobar還是取不到real ip
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友回答

立即登入回答