How to setup forward proxy on Windows server for outgoing HTTP and HTTPS requests?
Asked Answered
S

1

8

I have a windows server 2012 VPS running a web app behind Cloudflare. The app needs to initiate outbound connections based on user actions (eg upload image from URL). The problem is that this 'leaks' my server's IP address and increases risk of DDOS attacks.

So I would like to prevent my server's IP from being discovered by setting up a forward proxy. So far my research has shown that this is no simple task, and would involve setting up another VPS to act as a proxy.

Does this extra forward proxy VPS have to be running windows ? Are their any paid services that could act as a forward proxy for my server (like cloudflare's reverse proxy system)?

Also, it seems that the suggested IIS forward proxy plugin, Application Request Routing, does not work for HTTPS.

Is there a solution for both types of outgoing (HTTPS + HTTP) requests?

I'm really lost here, so any help or suggestions would be appreciated.

Supertax answered 14/7, 2016 at 22:8 Comment(0)
M
3

You are correct in needing a "Forward Proxy". A good analogy for this is the proxy settings your browser has for outbound requests. In your case, the web application behaves like a desktop browser and can be configured to make the resource request through a proxy.

Often you can control this for individual requests at the application layer. An example of doing so with C#: C# Connecting Through Proxy

As far as the actual proxy server: No, it does not need to run Windows or IIS. Yes, you can use a proxy service. The vast majority of proxy services are targeted towards consumers and are used for personal privacy or to get around network restrictions. As such, I have no direct recommendations.

Cloudflare actually has recommendations regarding this: https://blog.cloudflare.com/ddos-prevention-protecting-the-origin/.

Features like "upload from URL" that allow the user to upload a photo from a given URL should be configured so that the server doing the download is not the website origin server.

This may be a more comfortable risk mitigator, as it wouldn't depend on a third party proxy service. A request for upload could be handled as a web service call to a dedicated "file downloader" server. Keep in mind that if you have a queued process for another server to do the work, and that server is hosted in the same infrastructure, both might be impacted by a DDoS, depending on the type of DDoS.

Your question implies that you may be comfortable using a non-windows server. Many softwares exist that can operate as a proxy(most web servers), but suffer from the same problem as ARR - lack of support for the HTTP "CONNECT" verb, which is used by modern browsers to start an HTTPS connection before issuing a "GET". SQUID is very popular, open source, and supports everything to connect to.. anything. It's not trivial to set up. Apache also has support for this in "mod_proxy_connect", but I have no experience in that and the online documentation isn't very robust. It's Apache, though, so it may be worth the extra investigation.

Misbegotten answered 18/10, 2016 at 19:20 Comment(1)
Thank you for your answer which has a lot of relevant information. Would just like to say, that I have just setup Squid and it was pretty quick and easy to get to work. (But maybe that's because it has improved since your answer.)Naught

© 2022 - 2024 — McMap. All rights reserved.