By AireServ
DNS Spoofing is considered…bad. But that’s only because people do not use it for good.
I am trying to block a directory of a website by spoofing it on my local DNS server. However, I do not want it to redirect. Here is an example of what I have done so far. The website shall remain unnamed for privacy.
http {
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://example.com/;
proxy_set_header host $http_host;
resolver 8.8.8.8;
}
location = /blocked/blocked.json
root /dns/;
autoindex on;
}
}
The directory of the website that I want to block (examp;e.com/iwantthisblocked) passes through the DNS and pulls up what it would without a DNS at all, however, the main directory of the website (example.com) throws a 500 internal server error.
This is running on an Ubuntu server with DNSMasq (DNS is set up properly).
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!
This comment has been deleted
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.