0

I have been doing some research on nginx for http_host. Somebody steals my content and I am trying to block it.

For example my website is www.mywebsite.com and a website www.thiefsite.com steals my content which I think is a proxy site. Whenever I change something it affects directly. I tried to see its IP etc with phpinfo I found the ip is cloudflare so there was no way to ban the IP but I saw on phpinfo

$_SERVER['HTTP_HOST'] = www.thiefsite.com $_SERVER['SERVER_NAME'] = www.thiefsite.com

My question is, is it possible for me to detect and block (or redirect to a page) http_host that is not my domain on nginx ?

I already have default but doesn't do anything.

`server { listen 443 default; server_name _;

ssl     on;
ssl_certificate         /etc/nginx/fake.crt;
ssl_certificate_key     /etc/nginx/fake.key;
ssl_client_certificate /etc/nginx/fake.crt;
ssl_verify_client on;

root         /opt/nginx/defalut;

return 403;
location / { deny all; }

} ` Thanks.

Cyber
  • 1
  • 2
  • You need to set up another `server` block to catch requests to other hostnames. See [this answer](https://stackoverflow.com/questions/34301884/nginx-reverse-proxy-only-allow-connection-from-hostname-not-ip/34307311#34307311). – Richard Smith Apr 15 '18 at 13:02
  • I tried that one also but didn't work. I also put the config that I tried. – Cyber Apr 15 '18 at 14:28

0 Answers0