通过frp配置aria2外网访问

在前一篇文章中,我们搭建了通过外网域名访问内网路由器后台的功能,其实在此基础上,可以很容易的搭建aria2远程下载功能。

前提

搭建好了aria2内网下载环境

实现

我们搭建好aria2内网下载环境后,会发现,aria2的配置信息,是通过6800端口的jsonrpc路由进行提供的,我们要做的就是把这一接口暴露出去。
还是使用frp来完成任务
frpc客户端配置,我们在frpc.ini中增加下面的配置


[aria2_rpc]
privilege_mode = true
type = http
local_ip = 127.0.0.1
local_port = 6800
use_gzip = true

connections will be established in advance, default value is zero

pool_count = 20

http username and password are safety certification for http protocol

if not set, you can access this custom_domains without certification

http_user = admin

http_pwd = admin

if domain for frps is frps.com, then you can access [web01] proxy by URL http://test.frps.com

subdomain = aria2


nginx配置

server {
listen 80 ;
listen [::]:80 ;
server_name aria2.xxx.com;

# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;

location / {
    proxy_pass http://127.0.0.1:8081;
    proxy_set_header   Host    $host;
    proxy_set_header   X-Real-IP   $remote_addr;
    proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
}

}


此时我们访问aria2.xxx.com/jsonrpc,就相当于访问了localhost:6800/jsonrpc
此时我们把aria2.xxx.com/jsonrpc填到随便一个在线的aria2管理器,都可以远程管理下载了。

你可能感兴趣的:(通过frp配置aria2外网访问)