Question

Redirect all the traffic not from my domain to 404

Someone is pointing their domain to our ip address, essentially cloning our website. After researching I came across that this is not issue with digitalocean or my droplet but rather I’d have to configure my nginx in a way that all traffic from domains other than mine are redirected to 404 or somewhere else.

I am not able to figure out how to do achieve that. Should I use map feature in nginx and if yes how does redirect from domain except mine works?


Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi @swimmingaqualobster,

You don’t have power over Domains that are not under your configuration. It would be strange to have a domain being pointed at your Droplet as it shouldn’t work, there would be no Nginx config file for it and thus your Droplet wouldn’t know how to load it.

Can you please explain a little bit more about the situation in order to help you out properly? Thanks and looking forward to your reply!