fix change transport xray

This commit is contained in:
mercury
2024-12-22 14:33:00 +04:00
parent 2c1db5f233
commit ef690349fd
3 changed files with 71 additions and 71 deletions
+9 -7
View File
@@ -5959,7 +5959,7 @@ DNS-over-HTTPS with IP:
"network" => "ws",
"security" => "tls",
"wsSettings" => [
"path" => "/ws?ed=2560"
"path" => "/ws$hash?ed=2560"
],
"tlsSettings" => [
"allowInsecure" => false,
@@ -5994,7 +5994,7 @@ DNS-over-HTTPS with IP:
unset($c['outbounds'][$index]['flow']);
$c['outbounds'][$index]["transport"] = [
"type" => "ws",
"path" => "/ws"
"path" => "/ws$hash"
];
$c['outbounds'][$index]['tls']['server_name'] = '~domain~';
} else {
@@ -6012,7 +6012,7 @@ DNS-over-HTTPS with IP:
unset($c['proxies'][$index]['flow']);
unset($c['proxies'][$index]['reality-opts']);
$c['proxies'][$index]["network"] = "ws";
$c['proxies'][$index]["ws-opts"]['path'] = '/ws';
$c['proxies'][$index]["ws-opts"]['path'] = "/ws$hash";
$c['proxies'][$index]["skip-cert-verify"] = false;
$c['proxies'][$index]['servername'] = '~domain~';
} else {
@@ -6348,11 +6348,11 @@ DNS-over-HTTPS with IP:
$template = file_get_contents('/config/nginx_default.conf');
$template = preg_replace('~server_name ip~', "server_name {$this->ip}", $template);
$template = preg_replace('~server_name domain~', "server_name " . ($conf['domain'] ? " *.{$conf['domain']} {$conf['domain']}" : '_'), $template);
if (!empty($conf['letsencrypt'])) {
if ($conf['domain'] && $conf['letsencrypt']) {
$template = preg_replace('/#~([^\n]+)?/', "#~{$conf['letsencrypt']}", $template);
preg_match_all('~#-ssl.+?#-ssl~s', $template, $m);
preg_match_all('~#-domain.+?#-domain~s', $template, $m);
foreach ($m[0] as $v) {
$template = preg_replace('~#-ssl.+?#-ssl~s', $this->uncomment($v, 'ssl'), $template, 1);
$template = preg_replace('~#-domain.+?#-domain~s', $this->uncomment($v, 'domain'), $template, 1);
}
}
$h = $this->getHashBot();
@@ -7096,7 +7096,9 @@ DNS-over-HTTPS with IP:
$p = $this->getPacConf();
$x = $this->getXray();
$h = $this->getHashBot();
$p['transport'] = $ws ? 'Websocket' : 'Reality';
$p['reality']['domain'] = $p['reality']['domain'] ?: 'web.telegram.org';
$p['reality']['destination'] = $p['reality']['destination'] ?: $p['reality']['domain'] . ':443';
$p['transport'] = $ws ? 'Websocket' : 'Reality';
if (!empty($ws)) {
$p['reality']['domain'] = $x['inbounds'][0]['streamSettings']['realitySettings']['serverNames'][0] ?: $p['reality']['domain'];
$p['reality']['destination'] = $x['inbounds'][0]['streamSettings']['realitySettings']['dest'] ?: $p['reality']['destination'];
+58 -64
View File
@@ -35,8 +35,6 @@ http {
}
}
#~
server {
server_name ip;
listen 10.10.0.2:443 ssl http2 proxy_protocol;
@@ -103,74 +101,70 @@ http {
proxy_pass https://ad/dns-query;
}
}
server {
server_name domain;
listen 10.10.0.2:443 ssl http2 proxy_protocol;
listen 10.10.1.2:443 ssl http2;
#-ssl
# ssl_certificate /certs/cert_public;
# ssl_certificate_key /certs/cert_private;
#-ssl
ssl_certificate /certs/self_public;
ssl_certificate_key /certs/self_private;
access_log /logs/nginx_domain_access;
#~
location / {
root /app;
index override.html login.html;
try_files $uri $uri/ =404;
}
#-domain
# server {
# server_name domain;
# listen 10.10.0.2:443 ssl http2 proxy_protocol;
# listen 10.10.1.2:443 ssl http2;
# ssl_certificate /certs/cert_public;
# ssl_certificate_key /certs/cert_private;
location /tlgrm {
access_log /logs/nginx_tlgrm_access;
proxy_pass http://php;
}
# access_log /logs/nginx_domain_access;
location @php {
proxy_pass http://php;
}
# location / {
# root /app;
# index override.html login.html;
# try_files $uri $uri/ =404;
# }
location /adguard/ {
}
# location @php {
# proxy_pass http://php;
# }
location /webapp {
access_log /logs/nginx_webapp_access;
alias /app;
index index.html;
try_files $uri $uri/ @php;
}
# location /adguard/ {
# }
location /pac {
access_log /logs/nginx_pac_access;
proxy_set_header Host $http_host;
proxy_pass http://php;
}
# location /webapp {
# access_log /logs/nginx_webapp_access;
# alias /app;
# index index.html;
# try_files $uri $uri/ @php;
# }
location /ws {
proxy_pass http://xr:443;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_read_timeout 5d;
}
# The DoH server block
location /dns-query {
access_log /logs/nginx_doh_access;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $remote_addr;
proxy_cache doh_cache;
proxy_cache_key $scheme$proxy_host$uri$is_args$args$request_body;
proxy_pass https://ad/dns-query;
}
}
# location /pac {
# access_log /logs/nginx_pac_access;
# proxy_set_header Host $http_host;
# proxy_pass http://php;
# }
# location /ws {
# proxy_pass http://xr:443;
# proxy_redirect off;
# proxy_http_version 1.1;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection "upgrade";
# proxy_set_header Host $host;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_read_timeout 5d;
# }
# # The DoH server block
# location /dns-query {
# access_log /logs/nginx_doh_access;
# proxy_http_version 1.1;
# proxy_set_header Connection "";
# proxy_set_header Host $host;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-Proto https;
# proxy_set_header X-Forwarded-For $remote_addr;
# proxy_set_header X-Forwarded-Host $remote_addr;
# proxy_cache doh_cache;
# proxy_cache_key $scheme$proxy_host$uri$is_args$args$request_body;
# proxy_pass https://ad/dns-query;
# }
# }
#-domain
}
+4
View File
@@ -110,6 +110,10 @@
"protocol": "dns",
"outbound": "dns-out"
},
{
"addruleset": true,
"outbound": "direct"
},
{
"addruleset": true,
"createruleset": [