Using haproxy how do I get Discourse to recognize remote IP?


(David Hagar) #1

I’m using haproxy as a way of having apache, webmin, and pwm running on the same machine under different subdomains. The setup works beautifully, but Discourse shows the localhost for the IP address for all user activity, clearly this is going to make fighting spam harder (IP blocking would not work, etc).

Is there a way to get discourse to recognize the proper remote IP addresses?


(David Hagar) #2

I solved this myself.

I had to add this to my haproxy.cfg under “defaults”:

option forwardfor

I feel kinda dumb, I had it in the wrong spot.


(Sam Saffron) #3