NPM (Nginx Proxy Manager) Reverse Proxy ARIA2's JSONRPC

npm-aria2.jpg
npm-aria2.jpg

aria2 is a lightweight multi-pro­to­col & multi-source com­mand-line download utility. It sup­ports HTTP/HTTPS, FTP, SFTP, BitTorrent and Metalink.

The SSL cer­tifi­cate used by the Aria2 server does not sup­port port 6800, so NPM (Ng­inx Proxy Man­ager) needs to be used to pro­vide both HTTP(s) and Aria2 JSONRPC ser­vices.


Edit NPM (Nginx Proxy Manager)

Proxy Host >> Advanced

2023-01-26_153027.png
2023-01-26_153027.png

#ARIA2
    location /jsonrpc {
        proxy_pass http://10.2.2.3:6800/jsonrpc;
        proxy_redirect off;
        proxy_set_header        X-Real-IP       $remote_addr;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $host;
    #The following code supports WebSocket
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
ParameterDescription
location /jsonrpcRPC address is //example.com/jsonrpc
http://10.2.2.3:6800/jsonrpcThe full path of the host (10.2.2.3 is host IP address)

Final Result:

2023-01-26_153126.png
2023-01-26_153126.png

2023-01-26_153139.png
2023-01-26_153139.png

You can now con­nect to ARIA2 RPC via "https" and "wss" (Web­Socket Se­cure).

Reference: