<div dir="ltr"><div><div>Good Afternoon Good People,</div><div><br></div><div>I am reaching out for some assistance with configuring a client’s website to accept traffic only from Cloudflare’s network.<br><br>I have attempted to achieve this by editing the .htaccess file to allow Cloudflare’s IP ranges and deny all other connections. However, after applying the configuration, I’m receiving a <b>“Forbidden - Access is denied”</b> error.<br><br>Here’s a summary of the situation:<br><ul><li><b><u>Hosting environment:</u></b> nginx on cPanel.</li><li><b><u>Goal:</u></b> Restrict direct access to the origin server, allowing only Cloudflare’s IP addresses.</li><li><u><b>Action taken:</b></u> Added allow/deny directives to .htaccess using Cloudflare’s published IP ranges.</li><li><u><b>Issue:</b></u> Website becomes inaccessible <i>(403 Forbidden).</i></li></ul>I have double-checked the syntax and updated Cloudflare’s IP list, but the issue persists. If anyone has experience setting this up or can suggest the correct configuration or an alternative approach <i>(e.g., using server-level configuration instead of .htaccess),</i> I would greatly appreciate your insight.</div></div><div><br></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Warm regards, <br><br>Michael Bullut. <br><br>--- <br><br><b><u>Cellphone:</u></b> <i>+254 723 393 114.</i><div><b><u>Twitter:</u></b> <a href="https://x.com/MichaelBullut" target="_blank"><i>@MichaelBullut</i></a></div><div><u><b>Blog:</b></u> <i><a href="http://www.kipsang.com/" target="_blank">http://www.kipsang.com/</a></i><br><b><u>E-mail Address:</u></b> <a href="mailto:main@kipsang.com" target="_blank"><i>main@kipsang.com</i></a><br><br>---</div></div></div></div></div><div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br><table style="border-top:1px solid #d3d4de"><tr><td style="width:55px;padding-top:13px"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" target="_blank"><img src="https://s-install.avcdn.net/ipm/preview/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" width="46" height="29" style="width: 46px; height: 29px;"></a></td><td style="width:470px;padding-top:12px;color:#41424e;font-size:13px;font-family:Arial,Helvetica,sans-serif;line-height:18px">Virus-free.<a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" target="_blank" style="color:#4453ea">www.avast.com</a></td></tr></table><a href="#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"></a></div>