免责声明:该项目所涉及软件及代码均为网上搜集整理,仅为个人笔记,若涉及您的版权,请联系本人删除。
原版安装:
bash <(curl -Ls https://raw.githubusercontent.com/vaxilu/x-ui/master/install.sh)
多功能版安装:
bash <(curl -Ls https://raw.githubusercontent.com/FranzKafkaYu/x-ui/master/install.sh)
apt install nginx
curl https://get.acme.sh | sh
ln -s /root/.acme.sh/acme.sh /usr/local/bin/acme.sh
acme.sh --set-default-ca --server letsencrypt
acme.sh --issue -d cloudfreeosk.cf -k ec-256 --webroot /var/www/html
acme.sh --install-cert -d example.com --ecc --key-file /etc/x-ui/server.key --fullchain-file /etc/x-ui/server.crt --reloadcmd "systemctl force-reload nginx"
cd /usr/bin
tar -zxvf cloudreve_3.5.3_linux_amd64.tar.gz
chmod +x ./cloudreve
./cloudreve
#结束Cloudreve安装 Ctrl+C
vim /usr/lib/systemd/system/cloudreve.service #输入i开始编辑
[Unit]
Description=Cloudreve
Documentation=https://docs.cloudreve.org
After=network.target
After=mysqld.service
Wants=network.target
[Service]
WorkingDirectory=/usr/bin
ExecStart=/usr/bin/cloudreve
Restart=on-abnormal
RestartSec=5s
KillMode=mixed
StandardOutput=null
StandardError=syslog
[Install]
WantedBy=multi-user.target
Esc :wq回车
systemctl daemon-reload
systemctl start cloudreve
systemctl enable cloudreve
输入域名:9999登录,XRAY切换最新版本。入站列表添加节点,监听IP:127.0.0.1,端口10000,传输:ws。添加。 面板设置:监听IP:127.0.0.1,面板 url 根路径:/UUID-xui 保存重启。
vim /etc/nginx/nginx.conf#输入i开始编辑
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 1024;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
gzip on;
server {
listen 443 ssl;
server_name example.com; #你的域名
ssl_certificate /etc/x-ui/server.crt; #证书位置
ssl_certificate_key /etc/x-ui/server.key; #私钥位置
ssl_session_timeout 1d;
ssl_session_cache shared:MozSSL:10m;
ssl_session_tickets off;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers off;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://127.0.0.1:5212;
# 如果您要使用本地存储策略,请将下一行注释符删除,并更改大小为理论最大文件尺寸
client_max_body_size 20000m;
}
location /UUID { #分流路径
proxy_redirect off;
proxy_pass http://127.0.0.1:10000; #Xray端口
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /UUID-xui { #xui路径
proxy_redirect off;
proxy_pass http://127.0.0.1:9999; #xui监听端口
proxy_http_version 1.1;
proxy_set_header Host $host;
}
}
server {
listen 80;
location /.well-known/ {
root /var/www/html;
}
location / {
rewrite ^(.*)$ https://$host$1 permanent;
}
}
}
Esc :wq回车
systemctl reload nginx
systemctl enable nginx
systemctl status nginx