Blocking ip thats not cf


#1

i saw your comment here Only allow Cloudflare IPs for Discourse server

could you go into a bit more detail as to what to do? and does this currently still works for you?
i only have a production server set up and i’d rather not ruin things lol


(Kane York) #2

Copy the templates/cloudlare.template.yml file to templates/cloudflare-only.template.yml, change the set_real_ip_from to allow, and add the deny all;.

Add both templates to your app.yml.

Make sure to keep a shell open until you’ve determined that it all works.


#3

#4

after trying it (i copied what you wrote here, did a rebuild, and it failed, i hope this could be a new feature? to allow a Block all ip that aren’t Cloudflare’s mode.

i’m limited to what i can do because i only have a production server atm, had was to test it out there lol