Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run on vps and domain #51

Open
xiongvalerio opened this issue Jun 2, 2024 · 1 comment
Open

run on vps and domain #51

xiongvalerio opened this issue Jun 2, 2024 · 1 comment

Comments

@xiongvalerio
Copy link

how to run this,on the vps and connect a domain?

@AmoghSaxena
Copy link
Contributor

AmoghSaxena commented Aug 28, 2024

You Can setup a reverse proxy or port forwading or VPN Tunnel Like cloudflare

Set Up Nginx Reverse Proxy for Webserver WebUI

A reverse proxy is a proxy for another web server, in this case the WebUI. Setting up Nginx reverse proxy makes it easy to enable HTTPS protocol.  Install Nginx on Ubuntu 18.04.

sudo apt install nginx

Start Nginx.

sudo systemctl start nginx

Then create a Nginx server block file for WebUI.

sudo nano /etc/nginx/conf.d/qbittorrent-webui.conf

Copy and paste the following texts into the file. Replace the red-colored text with your own domain name and the IP address of your Ubuntu server. You should also set the A record for your domain name. If you don’t have a domain name yet, then I recommend buying domain name from Namecheap because their price is lower than GoDaddy and they give you whois privacy protection free of charge.

server {
  listen 80;
  server_name name.your-domain.com;

  access_log /var/log/nginx/name.your-domain.com.access;
  error_log /var/log/nginx/name.your-domain.com.error;

  location / {
    proxy_pass              http://your-server-ip:8080/;
    proxy_set_header        X-Forwarded-Host        $server_name:$server_port;
    proxy_hide_header       Referer;
    proxy_hide_header       Origin;
    proxy_set_header        Referer                 '';
    proxy_set_header        Origin                  '';
    add_header              X-Frame-Options         "SAMEORIGIN";
  }
}

Save and close the file. Then test Nginx configuration.

sudo nginx -t

If the test is successful, reload Nginx

sudo systemctl reload nginx

Now in your router, forward HTTP request (port 80) to the IP address of your Ubuntu server. After that, you can access WebUI via your domain name (name.your-domain.com).

Note: If your ISP gives you a NAT-ed IP address, i.e. not a public IP address, then port forwarding won’t work. Instead, you need to use PageKite to expose local web server to the Internet.

Enable HTTPS to Encrypt Communications

To secure the Web UI, you can install a free TLS certificate issued by Let’s Encrypt. First you need to install the Let’s Encrypt client (certbot) on Ubuntu 18.04 server.

sudo apt install software-properties-common

sudo add-apt-repository ppa:certbot/certbot

sudo apt install certbot python3-certbot-nginx

Python3-certbot-nginx is the Certbot Nginx plugin. After they are installed, run the following command to automatically obtain and install Let’s Encrypt certificate.

sudo certbot --nginx --redirect --agree-tos --hsts --staple-ocsp --email your-email-address -d name.your-domain.com

Once that’s done, refresh the Web UI. It will be automatically redirected to HTTPS connection.

image

In my case I used CloudFlare for VPN Tunnel

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants