Closed totodata closed 3 years ago
自定义web站点得自己找下web伪装的html放到nginx 80的/路径下
只要改了端口,在后台trojan进行任何操作,都是失败。
[INFO] 2021/01/12 14:47:10 trojan-go v0.8.2 initializing [FATAL] 2021/01/12 14:47:10 github.com/p4gefau1t/trojan-go/proxy.(Node).BuildNext:stack.go:29 invalid redirect address. check your http server: 127.0.0.1:80 | dial tcp 127.0.0.1:80: connect: connection refused trojan.service: main process exited, code=exited, status=1/FAILURE Unit trojan.service entered failed state. trojan.service failed. trojan.service holdoff time over, scheduling restart. Stopped trojan-go. Started trojan-go. [INFO] 2021/01/12 14:47:13 trojan-go v0.8.2 initializing [FATAL] 2021/01/12 14:47:13 github.com/p4gefau1t/trojan-go/proxy.(Node).BuildNext:stack.go:29 invalid redirect address. check your http server: 127.0.0.1:80 | dial tcp 127.0.0.1:80: connect: connection refused trojan.service: main process exited, code=exited, status=1/FAILURE Unit trojan.service entered failed state. trojan.service failed. trojan.service holdoff time over, scheduling restart. Stopped trojan-go. Started trojan-go. [INFO] 2021/01/12 14:47:17 trojan-go v0.8.2 initializing [FATAL] 2021/01/12 14:47:17 github.com/p4gefau1t/trojan-go/proxy.(Node).BuildNext:stack.go:29 invalid redirect address. check your http server: 127.0.0.1:80 | dial tcp 127.0.0.1:80: connect: connection refused trojan.service: main process exited, code=exited, status=1/FAILURE Unit trojan.service entered failed state. trojan.service failed. trojan.service holdoff time over, scheduling restart. Stopped trojan-go. Started trojan-go. [INFO] 2021/01/12 14:47:20 trojan-go v0.8.2 initializing [FATAL] 2021/01/12 14:47:20 github.com/p4gefau1t/trojan-go/proxy.(Node).BuildNext:stack.go:29 invalid redirect address. check your http server: 127.0.0.1:80 | dial tcp 127.0.0.1:80: connect: connection refused trojan.service: main process exited, code=exited, status=1/FAILURE Unit trojan.service entered failed state. trojan.service failed.
默认的html根目录在哪呢?
改错了吧,应该是改trojan-web的端口,而不是trojan本身的端口,看清楚wiki改端口那部分
web文件没有释放出来,而是在bin文件里面的
没有改错的 trojan-web.service
ExecStart=/usr/local/bin/trojan web -p 端口号
80端口的nginx启动成功了吗,trojan-go要转发非trojan流量到80的
80端口的nginx需要另外安装是吗?怎么安装呢。
yum install nginx 或者apt-get install nginx
然后按照wiki那样修改nginx默认配置文件对吧。
/etc/nginx/nginx.conf
location /admin {
proxy_pass http://localhost:81/;
}
location ~* ^/(js|css|vendor|common|auth|trojan)/ {
proxy_pass http://localhost:81;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}
# http强制跳转到https
if ( $remote_addr != 127.0.0.1 ){
rewrite ^/(.*)$ https://example.com/$1 redirect;
}
是的
80网站可以访问了,可是所有css js都没生效。
安装玩nginx,应该加入自动启动服务。才能正常。
systemctl enable nginx.service
按照wiki,修改后admin后台的端口。 在后台切换go失败, 重启服务器,trojan服务启动不起来
还有如何加一个自定义web站点在默认80下