freeCodeCamp / discourse-meta

5 stars 4 forks source link

Update Discourse NGINX to use IP header as the IP going to Rails #42

Open QuincyLarson opened 7 years ago

QuincyLarson commented 7 years ago

I was going to perform a lookup to see if a blocked user had anymore accounts for further review but I realized an issue:

f4b919657c0122da7e4fc9126c4dd3b509abee67

The freeCodeCamp Forum isn’t setting the real ip address from Cloudflare (Ref: https://support.cloudflare.com/hc/en-us/articles/200170706-How-do-I-restore-original-visitor-IP-with-Nginx-) so checking to see which accounts this user is operating by IP Address isn’t a possibility.

This is the nature of being behind a proxy. You'll need to set up nginx in discourse to use the ip header as the ip going to rails.

This will require direct access to the Discourse production server, so if you know how to do this, you would need to hop on a Skype call with me and help walk me through it (we can't give out production SSH access for security reasons).

m-henderson commented 7 years ago

@QuincyLarson I can take care of this. Can we exchange info via private gitter?

QuincyLarson commented 7 years ago

@m-henderson If you know what precise changes need to be made can you share them with @berkeleytrue? This is one thing where we need to be really precise - otherwise we could crash the forum.

BerkeleyTrue commented 7 years ago

Here is how we do it in production

https://github.com/freeCodeCamp/static/blob/master/nginx.conf#L16