安装
首先,新添加一个网站(教程以使用lnmp.org
配置lnmp
环境的服务器作演示)
lnmp vhost add
进入网站根目录,执行
cd /home/wwwroot/sub.xxx.xxx wget 'https://github.com/tindy2013/subconverter/releases/download/v0.7.1/subconverter_linux64.tar.gz' tar -xvf subconverter_linux64.tar.gz mv subconverter subconverter2 mv subconverter2/* ./ rm -rf subconverter2 subconverter_linux64.tar.gz mkdir templates
然后执行
screen -S subconverter ./subconverter
然后配置nginx
- 添加 http 访问 301 重定向
server { listen 80; server_name sub.xxx.xxx ; return 301 https://$server_name$request_uri; }
- 添加反向代理
location / { proxy_pass http://0.0.0.0:25500; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; }
- 重启nginx
lnmp nginx restart
访问网站,正常情况下应该是这样
配置互转规则
仅为示范连接,使用时需将 sub.xxx.xxx
改为你的域名,将 sub_url
改为订阅地址
- clash
https://sub.xxx.xxx/sub?target=clash&url=sub_url
- clashr
https://sub.xxx.xxx/sub?target=clashr&url=sub_url
- quantumult
https://sub.xxx.xxx/sub?target=quan&url=sub_url
- quantumultx
https://sub.xxx.xxx/sub?target=quanx&list=true&url=sub_url
- surge4
https://sub.xxx.xxx/sub?target=surge&ver=4&url=sub_url
- surfboard
https://sub.xxx.xxx/sub?target=surfboard&url=sub_url
- v2ray
https://sub.xxx.xxx/sub?target=v2ray&url=sub_url
参考来源
https://github.com/tindy2013/subconverter
https://10101.io/2020/02/12/use-clash-proxy-provider-with-subconverter
https://limbopro.xyz/archives/subconverter.html
发表回复