🚈Configuring a Reverse Proxy
Follow these steps:
Login to your DNS and domain manager (ex. Cloudflare), go to your domain and create a DNS record of type A. For a name put what you want your subdomain to be (ex.
client
ordash
). You can also put@
for the root. On IPv4 Address put the IP of the VPS you'll use to configure the Nginx Reverse Proxy (yeah, you will need a VPS to do this).
Note for Cloudflare Users
Ensure the subdomain is gray-clouded (not proxied). This is because you will need more ports than just web ones accessible.

Login to your VPS using SSH and run the following commands:
export DOMAIN="<your subdomain from step 1>"
apt install nginx && apt install certbot &&
ufw allow 80 && # or some other fiewall
ufw allow 443 &&
certbot certonly -d $DOMAIN
Alternative method to request a certificate:
certbot certonly -d <subdomain>
Select option 1 (Nginx Webserver) and follow the steps you will see.
nano /etc/nginx/sites-enabled/lapsusclient.conf
Paste the following code, replacing
<domain>
with your domain and<port>
with your port (default 8000).
server {
listen 80;
server_name <domain>;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
location /afkwspath {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass "http://yourLapsusUrl:<port>/afkwspath";
}
server_name <domain>;
ssl_certificate /etc/letsencrypt/live/<domain>/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/<domain>/privkey.pem;
ssl_session_cache shared:SSL:10m;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
proxy_pass http://yourLapsusUrl:<port>/;
proxy_buffering off;
proxy_set_header X-Real-IP $remote_addr;
}
}
Close your editor and run
sudo systemctl restart nginx
.
If you don't get an error, everything is working correctly and now you can use your custom domain! If you get an error from your shell, check you followed all steps correctly.
Last updated