In my current project , there is a necessity to turn off some features if the client is from a specific region (we are looking at only one region and this is not going to change). I was looking at different options to identify the client ip and identify their region.
- Identify the client ip at the nginx level (thats our web server) and set a header to the request(There are a few nginx modules that can be easily configured for this that also needs some geoip dbs to be plugged in). Look for this header at the web layer and do specific actions.
- Identify the client at the web layer (sinatra , ruby app) , by intercepting every request , identifying the client ip and checking against the list of isp networkaddress/subnet(stored in a text file) of the region we are looking at.
What is the generally accepted practice? What is likely to be more performant?
Aucun commentaire:
Enregistrer un commentaire