Oneinstack lnmp反代理alist

一、alist 安装

参见alist官方文档:https://alist.nn.ci/zh/guide/install/script.html

安装:

curl -fsSL "https://alist.nn.ci/v3.sh" | bash -s install /path_to_web/

更新:

curl -fsSL "https://alist.nn.ci/v3.sh" | bash -s update

卸载:

curl -fsSL "https://alist.nn.ci/v3.sh" | bash -s uninstall

设置密码:

# 随机生成一个密码
./alist admin random
# 手动设置一个密码,`NEW_PASSWORD`是指你需要设置的密码
./alist admin set NEW_PASSWORD

然后就可以 ip+port (port默认是5244) 访问了

如果是阿里云,需要在安全组添加5244端口放行,如果

二、oninstack 配置

正常使用./vhost 添加网站,会提示nginx conf的位置,比如我的就提示文件在:

/usr/local/nginx/conf/vhost/oss.p-chao.com.conf

修改为下面,特别留意下最后的location字段,指定了本地的5244端口

server {
  listen 443 ssl http2;
  listen [::]:443 ssl http2;
  ssl_certificate /usr/local/nginx/conf/ssl/oss.p-chao.com.crt;
  ssl_certificate_key /usr/local/nginx/conf/ssl/oss.p-chao.com.key;
  ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
  ssl_ciphers TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256:EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
  ssl_prefer_server_ciphers on;
  ssl_session_timeout 10m;
  ssl_session_cache builtin:1000 shared:SSL:10m;
  ssl_buffer_size 1400;
  add_header Strict-Transport-Security max-age=15768000;
  ssl_stapling on;
  ssl_stapling_verify on;
  server_name oss.p-chao.com;
  access_log /data/wwwlogs/oss.p-chao.com_nginx.log combined;
  
  
  location / {
    proxy_pass http://127.0.0.1:5244;
  }
}

修改好之后在 /usr/local/nginx 目录下运行

./sbin/nginx -t

./sbin/nginx -s reload 就可以了

发表评论