SandNight commented on issue #11907: URL: https://github.com/apache/apisix/issues/11907#issuecomment-2591786244
> [@SandNight](https://github.com/SandNight) I had a similar issue and adding the below apisix configuration in the httpSrv block of the nginx fixed the issue for me. set_real_ip_from 0.0.0.0/0; real_ip_header X-Forwarded-For; real_ip_recursive on; > > Full block of code example: (line 476,477,478) > > <img alt="Image" width="881" src="https://private-user-images.githubusercontent.com/74243900/403077132-95d98456-9ea7-408e-8563-a4a0dec49bc8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzY5MDU0NTcsIm5iZiI6MTczNjkwNTE1NywicGF0aCI6Ii83NDI0MzkwMC80MDMwNzcxMzItOTVkOTg0NTYtOWVhNy00MDhlLTg1NjMtYTRhMGRlYzQ5YmM4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAxMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMTE1VDAxMzkxN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNkNDBjMDlmZjNiODU4N2UxYjUwZDc1MmM4NDdkODg0Zjc5MzYzZDgzZmRlZDVjNmUzNzVkOWMwMDY2OWNhMDUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.lhil4mky4rVBB9WEafc2jwn51S9hCDwsaJ4vn-EtZyc"> thank you! I tried 3 different config in apisix(3.11) config.yaml 1. nginx_config: # Config for render the template to generate nginx.conf configurationSnippet: main: | httpStart: | httpEnd: | httpSrv: | set_real_ip_from 0.0.0.0/0; real_ip_header X-Forwarded-For; real_ip_recursive on; 2. nginx_config: # Config for render the template to generate nginx.conf http: real_ip_recursive: "on" real_ip_header: X-Forwarded_For real_ip_from: - 0.0.0.0/0 3. nginx: configurationSnippet: main: | httpStart: | httpEnd: | httpSrv: | set_real_ip_from 0.0.0.0/0; real_ip_header X-Forwarded-For; real_ip_recursive on; None of them can get the correct ip -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
