I want to prevent browsing and access to my server "using the server's IP" and that the traffic of visitors is only through the cloudflare, is there any way to do that?
Asked
Active
Viewed 39 times
-2
-
What service are you running? – JG7 Sep 09 '22 at 22:41
-
Use Linux Ubuntu 18 – HATEM Sep 09 '22 at 22:50
-
Nginx? Apache? Your question doesn’t contain many details so the community will struggle to support you. – JG7 Sep 09 '22 at 22:51
-
Nginx, I apologize for my lack of experience, I'm a beginner on these matters – HATEM Sep 09 '22 at 22:58
-
Ah, using an IP based block? It is not like Cloudflare is not publishing the lists of IP ranges that they will use. – TomTom Sep 10 '22 at 02:21
2 Answers
1
Refer to this Digital Ocean guide covering this specific topic.
Note the line that states the following:
In the next section, you will set up Authenticated Origin Pulls to verify that your origin server is indeed talking to Cloudflare and not some other server. By doing so, Nginx will be configured to only accept requests that use a valid client certificate from Cloudflare; all requests that have not passed through Cloudflare will be dropped.
![](../../users/profiles/618446.webp)
JG7
- 196
- 5
1
Block by IP range. Simple. It is not like Cloudflare is not publishing the list of IP ranges they use...
https://www.cloudflare.com/en-gb/ips/
(note: also accessible through their API).
Limit by that IP's, done.
![](../../users/profiles/37059.webp)
TomTom
- 50,857
- 7
- 52
- 134