None of the wikis from both ssmgr project and trojan project had any clearance of how ssmgr supported redis for trojan.
Let me clear those misleading for you, and you won't need wasting hours looking for answers which you will never get from the wiki.
{
"run_type": "server",
"local_addr": "127.0.0.1",
"local_port": 2443,
"remote_addr": "127.0.0.1",
"remote_port": 80,
"password": [
"FixedPassword1",
"FixedPassword2"
],
"log_level": 0,
"ssl": {
"cert": "/home/ubuntu/.acme.sh/your.domain/fullchain.cer",
"key": "/home/ubuntu/.acme.sh/your.domain/your.domain.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"
],
"alpn_port_override": {
"h2": 81
},
"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": true,
"fast_open_qlen": 20
},
"redis": {
"enabled": true,
"server_addr": "localhost",
"server_port": 6379,
"password": ""
},
"mysql": {
"enabled": false,
"server_addr": "10.0.0.45",
"server_port": 3306,
"database": "trojan",
"username": "trojan",
"password": "thisisthetrojandbpassword",
"cafile": ""
}
}
Sharing nginx with trojan and mtproto.
nginx.conf
stream {
#------------------------------
server {
listen 443;
listen [::]:443;
proxy_pass $name;
proxy_protocol on; # Key step support HAProxy proxy_protocol
ssl_preread on; # preread SNI hostname
access_log /var/log/nginx/stream_access.log streamlog;
error_log /var/log/nginx/stream_error.log; # Health check notifications
}
map $ssl_preread_server_name $name {
trojan.your.domain trojan_pre;
www.dummpysite.com mtproxy;
"~^cget\d{0,1}\.your\.domain $" LocalBackEnd;
default LocalBackEnd;
}
#------------------------------
upstream trojan_pre {
server 127.0.0.1:2442;
}
server {
listen localhost:2442 reuseport proxy_protocol;
proxy_pass trojan;
}
upstream trojan {
server 127.0.0.1:2443;
}
#------------------------------
upstream mtproxy {
server 127.0.0.1:3443;
}
#------------------------------
upstream LocalBackEnd {
server localhost:1443; # temp server
}
}
http {
.....
include /etc/nginx/sites-enabled/*;
}