部署AList

新建路径文件夹

1
mkdir /www/wwwroot/alist.yumefusaka

安装AList

1
curl -fsSL "https://alist.nn.ci/v3.sh" | bash -s install /www/wwwroot/alist.yumefusaka
1
2
3
4
5
6
7
8
9
10
11
12
官方提供的命令:
# Install
curl -fsSL "https://alist.nn.ci/v3.sh" | bash -s install /www/wwwroot/alist.yumefusaka
# update
curl -fsSL "https://alist.nn.ci/v3.sh" | bash -s update /www/wwwroot/alist.yumefusaka
# Uninstall
curl -fsSL "https://alist.nn.ci/v3.sh" | bash -s uninstall /www/wwwroot/alist.yumefusaka

启动: systemctl start alist
关闭: systemctl stop alist
状态: systemctl status alist
重启: systemctl restart alist

修改密码

1
2
cd /www/wwwroot/alist.yumefusaka/alist
./alist admin set NEW_PASSWORD

进入AList

开放安全组和防火墙后即可通过ip:5244访问AList


宝塔设置反向代理

登录宝塔面板,添加站点

bt_new_website

修改站点设置

bt_new_website_01

删除面板默认代码

bt_delete_default_config_01

bt_delete_default_config_02

在网站配置文件的 server 字段中添加

1
2
3
4
5
6
7
8
9
10
11
12
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Range $http_range;
proxy_set_header If-Range $http_if_range;
proxy_redirect off;
proxy_pass http://127.0.0.1:5244;
# the max size of file to upload
client_max_body_size 20000m;
}

如果需要使用HTTP/3,需要将对应HOST行修改为:

1
proxy_set_header Host $host:$server_port;

这样修改后的配置同时也可以兼容HTTP/2及更低版本的请求。

并在/www/server/nginx/conf/proxy.conf中或对应网站配置文件中设置禁用Nginx缓存,否则默认配置下访问较大文件时Nginx会先尝试将远程文件缓存至本机,导致播放失败

1
2
proxy_cache cache_one; # 删除这一行
proxy_max_temp_file_size 0; #加上这一行

添加反向代理

bt_reverse_proxy


完结撒花