My website is Loading via Domain, but i cant load it via IP address, i keep getting error 404. And all the dns look ups are fine.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi Samuel!
If your website loads via the domain but gives a 404 error when accessed via the IP address, it’s likely due to how your web server (like Nginx or Apache) is configured.
Basically, web servers use Virtual Hosts (in Apache) or Server Blocks (in Nginx) to map requests to the correct site based on the domain name (the
Host
header). If no specific configuration matches the IP address, the server returns a default 404 error.To learn more about virtual hosts and server blocks check out these two articles:
For Nginx:
For Apache:
To fix this you will have to check a few things:
Check Virtual Host or Server Block Configuration
Make sure your server configuration includes a default host that serves your website when accessed via the IP.
For Apache:
For Nginx:
Restart the Web Server
After updating the configuration, restart your web server:
Check Firewall Settings
Ensure port 80 (HTTP) or 443 (HTTPS) is open:
Verify the IP Address
Confirm you are using the correct public IP of your server.
Feel free to share more details on your exact setup and the guides that you’ve follow to set it all up and I can give you more information on how you could solve this if the above does not work.
Let me know if this helps!
- Bobby
Heya,
This is entirely up to your Nginx/Apache configuration. Can you share which one you are using? So, basically, it’s not related to your Domain but your WebService configuration file.