From f25c5cb60c6069f31c0a89526784cc3674ad2b8e Mon Sep 17 00:00:00 2001 From: fzorb Date: Fri, 17 Jan 2025 07:47:25 +0200 Subject: [PATCH] edit selfhosting safely --- content/posts/safely-selfhosting.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/content/posts/safely-selfhosting.md b/content/posts/safely-selfhosting.md index d1e7008..b5969cc 100644 --- a/content/posts/safely-selfhosting.md +++ b/content/posts/safely-selfhosting.md @@ -13,14 +13,14 @@ Selfhosting is a great way to fight decentralization, however, you might find yo * You can technically run your whole setup off mobile data, but should you? No, not at all, but in case your ISP goes down you could do this. ## Requirements: -* **A VPS**: I reccomend https://buyvm.net/ but you can get away with most VPS providers, granted your service doesn't break their AUP. Since I am too poor to rent another VPS from them for the sake of this tutorial, I decided to use Oracle Cloud's generous free tier. +* **A VPS**: ~~I reccomend https://buyvm.net/~~ ([BuyVM's future is uncertain](https://lowendtalk.com/discussion/201647/for-immediate-release-buyvm-joins-cloudzy-ai/p1)) but you can get away with most VPS providers, granted your service doesn't break their AUP. Since I am too poor to rent another VPS from them for the sake of this tutorial, I decided to use Oracle Cloud's generous free tier. * **A domain**: This isn't really required but realistically you're going to need one. I like https://namecheap.com/ but you could get it from other places too * **A server**: Duh, if you don't have one of those you'll obviously have to run your services on the VPS, which at this point, why even follow this tutorial? ## Step 1. setting the VPS up. I'll be using Ubuntu, but these commands will work on Debian too. ``` -sudo apt install curl nginx certbot +sudo apt install curl nginx certbot python3-certbot-nginx sudo systemctl enable --now nginx ``` @@ -59,14 +59,13 @@ When a user wants to access your website, the Nginx server running on the VPS wi I'll assume you know how Nginx works, so I won't go into too much detail about how to configure. Below is a pretty simple configuration which can be edited however you want. Do with it as you will. ```conf server { - server_name example; location / { proxy_pass http://10.8.0.2; proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; } listen 80; listen [::]:80;