是这个大佬的脚本 ->https://github.com/jinwyp/one_click_script
我看星星很多,想去抄抄配置,没想美白哈
这 nginx 主配置
# user www-data www-data;
user root;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" "$http_x_forwarded_for"';
access_log /nginxweb/nginx-access.log main;
error_log /nginxweb/nginx-error.log;
sendfile on;
#tcp_nopush on;
keepalive_timeout 120;
client_max_body_size 20m;
gzip on;
include /etc/nginx/conf.d/*.conf;
}
这是网站的 nginx 配置
server {
listen 80;
server_name domain.net;
root /nginxweb/html;
index index.php index.html index.htm;
location /75f0d3d7 {
proxy_pass http://127.0.0.1:27493;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
这是 trojan 的配置
{
"run_type": "server",
"local_addr": "0.0.0.0",
"local_port": 443,
"remote_addr": "127.0.0.1",
"remote_port": 80,
"password": [
"123",
"12345"
],
"log_level": 1,
"log_file": "/root/trojan-access.log",
"ssl": {
"verify": true,
"verify_hostname": true,
"cert": "/nginxweb/cert/fullchain.cer",
"key": "/nginxweb/cert/private.key",
"sni": "domain.net",
"fallback_addr": "127.0.0.1",
"fallback_port": 80,
"fingerprint": "chrome"
},
"websocket": {
"enabled": true,
"path": "/0a195182",
"host": "domain.net"
}
}
netstat -tlnp|grep 27493 也没看到 27493 端口有啥活动哈,链接不上的感觉哈~
1
xilou31 2022-12-18 22:05:17 +08:00
nginx 哪里用 443 了。。。不是只用了 80 端口吗
|
2
cweijan 2022-12-18 22:28:58 +08:00 1
应该是 trojan443 端口接收请求, 然后给转发到本地的 80 端口 Nginx
|
3
cha0sCat 2022-12-19 05:09:13 +08:00 via iPhone 1
troj 首先承载 443 端口流量
尝试以 troj 协议解密失败后,将流量原封不动转发到 80 nginx 实现伪装 |
5
yizmaoaa 2022-12-19 10:23:31 +08:00 1
nginx 监听 443 转发到 trojan ,如果你想 trojan 和别的程序共享 443 的话,用 nginx 监听 443 ,然后不同的域名转发到不同的端口
stream { map $ssl_preread_server_name $backend_name { 1.com web; 2.com trojan; default web; } upstream web { server 127.0.0.1:10242; } upstream trojan { server 127.0.0.1:8000; } server { listen 443 reuseport; listen [::]:443 reuseport; proxy_pass $backend_name; ssl_preread on; } } |