安装Acme

参考
在/root/下建立一个新文件夹ssl,把证书放到该目录下

安装Trojan

bash -c "$(curl -fsSL https://raw.githubusercontent.com/trojan-gfw/trojan-quickstart/master/trojan-quickstart.sh)"

编辑配置文件
(/usr/local/etc/trojan/config.json)

{
    "run_type": "server",
    "local_addr": "0.0.0.0",
    "local_port": 443,
    "remote_addr": "127.0.0.1",
    "remote_port": 80,
    "password": [
        "qwe123"
    ],
    "log_level": 1,
    "ssl": {
        "cert": "/root/ssl/banana-zone.best.fullchain.cer", ##证书位置
        "key": "/root/ssl/banana-zone.best.key",##证书位置
        "key_password": "",
        "cipher": "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384",
        "cipher_tls13": "TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384",
        "prefer_server_cipher": true,
        "alpn": [
            "http/1.1"
        ],
        "reuse_session": true,
        "session_ticket": false,
        "session_timeout": 600,
        "plain_http_response": "",
        "curves": "",
        "dhparam": ""
    },
    "tcp": {
        "prefer_ipv4": false,
        "no_delay": true,
        "keep_alive": true,
        "reuse_port": false,
        "fast_open": false,
        "fast_open_qlen": 20
    },
    "mysql": {
        "enabled": false,
        "server_addr": "127.0.0.1",
        "server_port": 3306,
        "database": "trojan",
        "username": "trojan",
        "password": ""
    }
}

重启命令

sudo systemctl restart trojan

状态命令

sudo systemctl status trojan

Trojan日志查看命令

journalctl -e -u trojan.service

更新Trojan命令

bash -c "$(curl -fsSL https://raw.githubusercontent.com/trojan-gfw/trojan-quickstart/master/trojan-quickstart.sh)"

提示是否需要覆盖的时候选择否

修改Nginx配置文件

如果没有nginx请先安装nginx

server {
    listen 127.0.0.1:80 default_server;

    server_name banana-zone.best;

    location / {
        proxy_pass https://banana-zone.tk;
    }

}

server {
    listen 127.0.0.1:80;

    server_name 47.240.45.14;

    return 301 https://banana-zone.bestrequest_uri;
}

server {
    listen 0.0.0.0:80;
    listen [::]:80;

    server_name _;

    return 301 https://host$request_uri;
}

设置伪装站

rm -rf /usr/share/nginx/html/*
cd /usr/share/nginx/html/
wget https://github.com/atrandys/v2ray-ws-tls/raw/master/web.zip && unzip web.zip 
systemctl restart nginx

后续

目前Trojan+Nginx+V2ray+WS+TLS共存没有问题。唯一的问题是如果搭建了Wordpress,会导致很多错误。