Forum OpenACS Development: [ad_conn peeraddr] returns 127.0.0.1

Request notifications

Collapse
Posted by Iuri Sampaio on
Hi there,
Even after setting up NGINX to be capable to get client's real IP, my OACS box doesn't return client's IP as expected, using [ad_conn peeradr]

(refs. https://ypereirareis.github.io/blog/2017/02/15/nginx-real-ip-behind-nginx-reverse-proxy/ and
https://easyengine.io/tutorials/nginx/forwarding-visitors-real-ip/ )

127.0.0.1 is the IP assigned within NS-config.tcl, Plus, if I sing any other IP such as: VPN's or external's IP, [ad_conn peeraddr] will return respectively.

I believe the issue is on Naviserver. I wonder if I need to rebuild it with extra modules. If so, which ones?

Context: NGINX runs in front of NaviServer, which serves OpenACS.

Best wishes

Collapse
Posted by Gustaf Neumann on
Have you checked the sample config file for OpenACS [1]? It has a variable called "proxy_mode" which should be set to "true" in such configurations. If you have done this, and no success, check your nginx setup, whether it provides the necessary "X-Forwarded-For" header field.

hope this helps.
-gn

[1] https://bitbucket.org/naviserver/naviserver/src/tip/openacs-config.tcl?at=default&fileviewer=file-view-default

Collapse
Posted by Iuri Sampaio on
Right on! A nice and easy parameter amend. It works now!
Thanks Gustaf
Collapse
Posted by Iuri Sampaio on
Just a few more information regarding the theme!
Collapse
Posted by Iuri Sampaio on
Just a few more information regarding the theme!

https://openacs.org/forums/message-view?message_id=1156435