Compare commits

...

3 Commits

Author SHA1 Message Date
mercury b10aaff459 fix domain for cdn 2024-09-22 01:06:02 +04:00
mercury 3271561418 update version 2024-09-19 13:44:35 +04:00
mercury 295ee6f2aa fix nginx.conf init 2024-09-19 12:11:05 +04:00
4 changed files with 36 additions and 8 deletions
+7 -8
View File
@@ -4729,7 +4729,7 @@ DNS-over-HTTPS with IP:
{
$type = $_GET['t'] == 's' ? 'v2ray' : 'sing';
$pac = $this->getPacConf();
$domain = $this->getDomain($pac['transport'] == 'Websocket');
$domain = $_GET['cdn'] ?: ($_SERVER['SERVER_NAME'] ?: $this->getDomain($pac['transport'] == 'Websocket'));
$xr = $this->getXray();
$scheme = empty($this->nginxGetTypeCert()) ? 'http' : 'https';
$hash = substr(md5($this->key), 0, 8);
@@ -4810,7 +4810,7 @@ DNS-over-HTTPS with IP:
switch ($_GET['t']) {
case 's':
$c['outbounds'][0]['settings']['vnext'][0]['address'] = $_GET['cdn'] ?: $domain;
$c['outbounds'][0]['settings']['vnext'][0]['address'] = $domain;
$c['outbounds'][0]['settings']['vnext'][0]['users'][0] = [
'id' => $uid,
'encryption' => 'none',
@@ -4824,7 +4824,7 @@ DNS-over-HTTPS with IP:
],
"tlsSettings" => [
"allowInsecure" => false,
"serverName" => $_GET['cdn'] ?: $domain,
"serverName" => $domain,
"fingerprint" => "chrome"
]
];
@@ -4862,7 +4862,7 @@ DNS-over-HTTPS with IP:
$c['dns']['servers'][0]['address'] = "https://$domain/dns-query/$uid";
}
$c['outbounds'][0]['server'] = $_GET['cdn'] ?: $domain;
$c['outbounds'][0]['server'] = $domain;
$c['outbounds'][0]['uuid'] = $uid;
if ($pac['transport'] == 'Websocket') {
unset($c['outbounds'][0]['tls']['reality']);
@@ -4871,7 +4871,7 @@ DNS-over-HTTPS with IP:
"type" => "ws",
"path" => "/ws"
];
$c['outbounds'][0]['tls']['server_name'] = $_GET['cdn'] ?: $domain;
$c['outbounds'][0]['tls']['server_name'] = $domain;
} else {
unset($c['outbounds'][0]["transport"]);
$c['outbounds'][0]['flow'] = 'xtls-rprx-vision';
@@ -4891,7 +4891,7 @@ DNS-over-HTTPS with IP:
$c['route']['rules'] = array_values($c['route']['rules']);
$c['route'] = $this->addRuleSet($c['route']);
$c['route'] = $this->addPackageRule($c['route']);
$c['route'] = $this->createRuleSet($c['route'], $uid);
$c['route'] = $this->createRuleSet($c['route'], $uid, $domain);
$c['route'] = $this->clearEmptyRules($c['route']);
break;
}
@@ -4948,10 +4948,9 @@ DNS-over-HTTPS with IP:
return $route;
}
public function createRuleSet($route, $uid)
public function createRuleSet($route, $uid, $domain)
{
$pac = $this->getPacConf();
$domain = $this->getDomain();
$scheme = empty($this->nginxGetTypeCert()) ? 'http' : 'https';
$hash = substr(md5($this->key), 0, 8);
+23
View File
@@ -48,6 +48,7 @@ http {
}
location /pac {
access_log /logs/nginx_pac_access;
proxy_set_header Host $http_host;
proxy_pass http://php;
}
location /tlgrm {
@@ -75,6 +76,27 @@ http {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_read_timeout 5d;
}
#-ssl
# # The DoH server block
# location /dns-query {
# access_log /logs/nginx_doh_access;
# # Proxy HTTP/1.1, clear the connection header to enable Keep-Alive
# 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;
# # Enable Cache, and set the cache_key to include the request_body
# proxy_cache doh_cache;
# proxy_cache_key $scheme$proxy_host$uri$is_args$args$request_body;
# # proxy pass to the dohloop upstream
# proxy_pass https://ad/dns-query;
# }
#-ssl
location ~\.well-known {
access_log /logs/nginx_certbot_access;
root /certs/;
@@ -118,6 +140,7 @@ http {
# }
# location /pac {
# access_log /logs/nginx_pac_access;
# proxy_set_header Host $http_host;
# proxy_pass http://php;
# }
# location ~\.well-known {
+2
View File
@@ -48,6 +48,7 @@ http {
}
location /pac {
access_log /logs/nginx_pac_access;
proxy_set_header Host $http_host;
proxy_pass http://php;
}
location /tlgrm {
@@ -139,6 +140,7 @@ http {
# }
# location /pac {
# access_log /logs/nginx_pac_access;
# proxy_set_header Host $http_host;
# proxy_pass http://php;
# }
# location ~\.well-known {
+4
View File
@@ -1,3 +1,7 @@
22.09.2024 v1.56.2
- фикс разных доменов при указании cdn для xray
19.09.2024 v1.56.1
- cdn для xray
17.09.2024 v1.55
- возможность подменить домен в ссылках на конфиги
16.09.2024 v1.54.2