1

I need ths behaviour When connecting to a special website from my client, I would like to receive a blank page as a result. For example if I connect to serverfault.com, I receive a blank page, but if I connect to google.com, I have the good website.

I'm currently using the following config:
Server 1: Client
Server 2: OpenVPN
Server 3: Proxy
Server 4: Website

The client connects to the website via curl using the proxy but the server itself is configured to use the VPN. So it simply does server 1 -> server 2 -> server 3 -> website.

I can't modify server 3 (a proxy provider) neither server 4 (could be whatever website). I need to configure something on server 1 or server 2.

I was thinking to add an header to my request (for example: SPECIALCONNECTION: Drop), and the server 2 check if I have this header. If it is present, it just drop the connection and return a blank page. But I don't see a way to configure OpenVPN easily to do this, so any ideas are welcome. :)

2
  • 3
    If I had those restrictions (cant touch 3 or 4) then I would have a proxy at Server 1 that I control and tell it what domains to (or not to) send up to the proxy at Server 3. Commented Jun 17, 2017 at 18:41
  • You should use content-filtering system like e2guardian on Server 2. Commented Jul 17, 2017 at 20:44

1 Answer 1

0

Since you are going through the VPN first, your proxy does not really have any control over the requests.

I think your best option is to tackle this problem through a DNS server. If you create DNS zones with no records for the sites you want to block, that will cause those to not resolve, or resolve to a page of your choosing if you put entries in them.

If you are in full control of all clients you would just need to change their DNS server.

However, make sure to configure your VPN settings properly so it does not tunnel externally to look for the DNS. You want it to search within the local subnet.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.