Self-Hosting a Reverse Proxy: My Journey to Ditching Cloudflare Tunnels
I’ve been using Cloudflare Tunnels for a while now to host some of my personal projects, like my archive and Jellyfin. But recently, I discovered that I was violating their terms of service, and I decided it was time to find an alternative. The problem is, my server is at home, and I use Starlink as my internet provider, which doesn’t allow port forwarding. This is actually a good thing, as it’s more secure, but it means I need to find another way to access my server from outside my network.
The Problem with Cloudflare Tunnels
I’ve been using Cloudflare Tunnels for free, but as I mentioned, I’m violating their terms of service. This got me thinking – what are the other options out there for self-hosting a reverse proxy? I started researching and found that there are actually quite a few alternatives. But before I dive into those, let me explain why I wanted to self-host a reverse proxy in the first place.
I have a server at my father’s shop, which I used to use for hosting game servers. But managing it remotely was a nightmare. I’d have to physically go to the shop to make any changes or fix issues, which was frustrating. That’s when I started using Cloudflare Tunnels, which made it easy to access my server from anywhere. But now that I’ve outgrown their free plan, I need to find a new solution.
What is a Reverse Proxy?
A reverse proxy is essentially a server that sits between your internet connection and your internal network. It helps to protect your internal network by only allowing incoming traffic on specific ports, and it can also help with load balancing and caching. In my case, I need a reverse proxy that supports both TCP and UDP, as I want to use it for both web servers and game servers.
After doing some research, I found a few options that looked promising. One of them was Pangolin, which seems to do everything I need. It’s a self-hosted reverse proxy that supports both TCP and UDP, and it’s relatively easy to set up.
Setting Up a Self-Hosted Reverse Proxy
Setting up a self-hosted reverse proxy can seem daunting, but it’s actually relatively straightforward. You’ll need a server or a device that can run the reverse proxy software, and you’ll need to configure it to point to your internal network. You’ll also need to set up port forwarding on your router, but this can be tricky if you’re not comfortable with networking.
One of the benefits of self-hosting a reverse proxy is that you have complete control over the configuration and security. You can choose which ports to open, and you can set up additional security measures like SSL encryption. You can also use a self-hosted reverse proxy to load balance traffic across multiple servers, which can help to improve performance and reliability.
Why Self-Host a Reverse Proxy?
So why would you want to self-host a reverse proxy? For me, it’s about having control over my own infrastructure. I don’t want to rely on a third-party service like Cloudflare, especially when I’m violating their terms of service. By self-hosting a reverse proxy, I can ensure that my server is secure and configured exactly how I want it.
Another benefit of self-hosting a reverse proxy is that it can be more cost-effective in the long run. While Cloudflare’s free plan is generous, it’s limited to a certain amount of traffic. If you need more bandwidth or features, you’ll have to upgrade to a paid plan. With a self-hosted reverse proxy, you can avoid these costs and have more flexibility in terms of configuration and scaling.
Conclusion
In conclusion, self-hosting a reverse proxy can be a great way to take control of your infrastructure and improve security and performance. While it may seem daunting at first, it’s actually relatively straightforward to set up and configure. If you’re looking for an alternative to Cloudflare Tunnels or other third-party services, I recommend checking out self-hosted reverse proxy options like Pangolin.
Samodzielne hostowanie serwera proxy: Moja podróż, aby porzucić Cloudflare Tunnels
Używałem Cloudflare Tunnels przez jakiś czas, aby hostować niektóre z moich projektów osobistych, takich jak mój archiwum i Jellyfin. Ale niedawno odkryłem, że naruszam ich warunki świadczenia usług i postanowiłem znaleźć alternatywę. Problem polega na tym, że mój serwer znajduje się w domu, a używam Starlink jako dostawcy internetu, który nie pozwala na przekierowanie portów. To jest tak naprawdę dobre, ponieważ jest to bardziej bezpieczne, ale oznacza to, że muszę znaleźć inny sposób, aby uzyskać dostęp do mojego serwera spoza mojej sieci.
Problem z Cloudflare Tunnels
Używałem Cloudflare Tunnels za darmo, ale jak wspomniałem, naruszam ich warunki świadczenia usług. To mnie zainspirowało do poszukiwania innych opcji do samodzielnego hostowania serwera proxy. Zacząłem szukać i znalazłem, że istnieje kilka alternatyw. Ale zanim przejdę do nich, pozwólcie, że wyjaśnię, dlaczego chciałem samodzielnie hostować serwer proxy.
Mam serwer w sklepie mojego ojca, który używałem do hostowania serwerów gier. Ale zarządzanie nim na odległość było koszmarem. Musiałem fizycznie udać się do sklepu, aby wprowadzić jakiekolwiek zmiany lub naprawić problemy, co było frustrujące. To wtedy zacząłem używać Cloudflare Tunnels, które ułatwiły mi dostęp do mojego serwera z dowolnego miejsca. Ale teraz, gdy przekroczyłem limit ich planu darmowego, muszę znaleźć nowe rozwiązanie.
Co to jest serwer proxy?
Serwer proxy to podstawowy serwer, który siedzi pomiędzy twoim połączeniem internetowym a Twoją wewnętrzną siecią. Pomaga on chronić Twoją wewnętrzną sieć, pozwalając na przychodzący ruch tylko na określonych portach, i może również pomóc w równoważeniu obciążenia i buforowaniu. W moim przypadku potrzebuję serwera proxy, który obsługuje zarówno TCP, jak i UDP, ponieważ chcę go używać zarówno do serwerów sieciowych, jak i gier.
Po przeprowadzeniu badań znalazłem kilka opcji, które wyglądały obiecująco. Jedną z nich był Pangolin, który zdaje się robić wszystko, czego potrzebuję. To jest samodzielnie hostowany serwer proxy, który obsługuje zarówno TCP, jak i UDP, i jest dość łatwy w konfiguracji.
Konfiguracja samodzielnego serwera proxy
Konfiguracja samodzielnego serwera proxy może wydawać się trudna, ale w rzeczywistości jest dość prosta. Potrzebujesz serwera lub urządzenia, które może uruchomić oprogramowanie serwera proxy, i musisz go skonfigurować, aby wskazywał na Twoją wewnętrzną sieć. Musisz również skonfigurować przekierowanie portów na twoim routerze, ale może to być trudne, jeśli nie czujesz się komfortowo z sieciami.
Jednym z korzyści samodzielnego hostowania serwera proxy jest to, że masz pełną kontrolę nad konfiguracją i bezpieczeństwem. Możesz wybrać, które porty otworzyć, i możesz skonfigurować dodatkowe środki bezpieczeństwa, takie jak szyfrowanie SSL. Możesz również użyć samodzielnego serwera proxy do równoważenia obciążenia ruchu na kilka serwerów, co może pomóc w poprawie wydajności i niezawodności.
Dlaczego samodzielnie hostować serwer proxy?
Dlaczego więc chciałbyś samodzielnie hostować serwer proxy? Dla mnie jest to kwestia kontroli nad własną infrastrukturą. Nie chcę polegać na usłudze trzeciej strony, takiej jak Cloudflare, zwłaszcza gdy naruszam ich warunki świadczenia usług. Samodzielne hostowanie serwera proxy pozwala mi zagwarantować, że mój serwer jest bezpieczny i skonfigurowany dokładnie tak, jak tego chcę.
Kolejną korzyścią samodzielnego hostowania serwera proxy jest to, że może być bardziej opłacalne w dłuższej perspektywie. Chociaż plan darmowy Cloudflare jest hojny, jest ograniczony do określonej ilości ruchu. Jeśli potrzebujesz więcej przepustowości lub funkcji, musisz uaktualnić do płatnego planu. Z samodzielnym serwerem proxy możesz uniknąć tych kosztów i mieć więcej elastyczności w zakresie konfiguracji i skalowalności.
Podsumowanie
Podsumowując, samodzielne hostowanie serwera proxy może być doskonałym sposobem, aby zwiększyć kontrolę nad infrastrukturą i poprawić bezpieczeństwo oraz wydajność. Chociaż może wydawać się trudne na początku, w rzeczywistości jest dość proste w konfiguracji. Jeśli szukasz alternatywy dla Cloudflare Tunnels lub innych usług trzecich, polecam sprawdzić samodzielnie hostowane serwery proxy, takie jak Pangolin.