How to Block Direct IP Access and Ensure Error 1003 Response

Additional information

I don’t know/other

What is the error number?

Error 1003

What is the issue you’re encountering

Error 1003 message

What steps have you taken to resolve the issue?

I have a website proxied through Cloudflare, and I want to ensure that direct access to my server’s IP address shows the Error 1003: Direct IP access not allowed message.

Currently, accessing my server via its IP address does not display this error, and I want to configure it properly through the Cloudflare dashboard.

Here’s my setup:

I have an A record in the DNS section pointing to my server’s IP, and it is set to Proxied (orange cloud icon).
My origin server is accessible via its IP address.
I want all direct IP requests to be blocked with the Error 1003 message while keeping my domain functional.
Could someone guide me through the steps to achieve this? Specifically:

Do I need to configure anything else in the Cloudflare dashboard to block IP access?
Should I set up firewall rules or other security settings?
How can I ensure all requests route only through Cloudflare?

What are the steps to reproduce the issue?

my server’s IP address shows the Error 1003: Direct IP access not allowed messag

Screenshot of the error

Direct Access to your IP address won’t go through Cloudflare, so there’s no way to have it return a Cloudflare error message. Any direct IP access block message would have to be configured at your host.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.