diff --git a/app/bot.php b/app/bot.php index 6e2a22f..bb99668 100644 --- a/app/bot.php +++ b/app/bot.php @@ -4199,16 +4199,16 @@ DNS-over-HTTPS with IP: ], ], [ + [ + 'text' => $this->i18n('ad_title'), + 'callback_data' => "/menu adguard", + ], [ 'text' => $this->i18n('warp') . ': ' . $this->warpStatus(), 'callback_data' => "/warp", ], ], [ - [ - 'text' => $this->i18n('ad_title'), - 'callback_data' => "/menu adguard", - ], [ 'text' => $this->i18n('pac'), 'callback_data' => "/pacMenu 0", diff --git a/config/nginx.conf b/config/nginx.conf index 156be81..9d611a4 100644 --- a/config/nginx.conf +++ b/config/nginx.conf @@ -23,12 +23,27 @@ http { set_real_ip_from 10.10.0.10; server { - listen 10.10.0.2:80 default_server; - listen 10.10.0.2:443 ssl http2 default_server proxy_protocol; + listen 80 default_server; + + location / { + return 301 https://$host$request_uri; + } + } + +#~ + + server { + server_name _; + 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_default_access; + access_log /logs/nginx_domain_access; location / { root /app; @@ -52,9 +67,10 @@ http { proxy_set_header Host $http_host; proxy_pass http://php; } - location /tlgrm { - access_log /logs/nginx_tlgrm_access; - proxy_pass http://php; + location ~\.well-known { + access_log /logs/nginx_certbot_access; + root /certs/; + try_files $uri =404; } location /ws { proxy_pass http://xr:443; @@ -66,113 +82,20 @@ http { proxy_set_header X-Real-IP $remote_addr; 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/; - try_files $uri =404; + } + # 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 - # server { - # listen 10.10.0.2:80; - # server_name ; -#-domain -#-ssl - # 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; -#-ssl - -#-domain - # access_log /logs/nginx_domain_access; - - # location / { - # root /app; - # index override.html login.html; - # try_files $uri $uri/ =404; - # } - # location /adguard/ { - # access_log /logs/nginx_adguard_access; - # proxy_pass http://ad:80/; - # proxy_redirect / /adguard/; - # proxy_cookie_path / /adguard/; - # } - # location /webapp { - # access_log /logs/nginx_webapp_access; - # alias /app; - # index index.html; - # try_files $uri $uri/ /pac?$query_string; - # } - # location /pac { - # access_log /logs/nginx_pac_access; - # proxy_set_header Host $http_host; - # proxy_pass http://php; - # } - # location ~\.well-known { - # access_log /logs/nginx_certbot_access; - # root /certs/; - # try_files $uri =404; - # } - # 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; - # } -#-domain -#-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 -#-domain - # } -#-domain } diff --git a/config/nginx_default.conf b/config/nginx_default.conf index 156be81..9d611a4 100644 --- a/config/nginx_default.conf +++ b/config/nginx_default.conf @@ -23,12 +23,27 @@ http { set_real_ip_from 10.10.0.10; server { - listen 10.10.0.2:80 default_server; - listen 10.10.0.2:443 ssl http2 default_server proxy_protocol; + listen 80 default_server; + + location / { + return 301 https://$host$request_uri; + } + } + +#~ + + server { + server_name _; + 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_default_access; + access_log /logs/nginx_domain_access; location / { root /app; @@ -52,9 +67,10 @@ http { proxy_set_header Host $http_host; proxy_pass http://php; } - location /tlgrm { - access_log /logs/nginx_tlgrm_access; - proxy_pass http://php; + location ~\.well-known { + access_log /logs/nginx_certbot_access; + root /certs/; + try_files $uri =404; } location /ws { proxy_pass http://xr:443; @@ -66,113 +82,20 @@ http { proxy_set_header X-Real-IP $remote_addr; 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/; - try_files $uri =404; + } + # 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 - # server { - # listen 10.10.0.2:80; - # server_name ; -#-domain -#-ssl - # 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; -#-ssl - -#-domain - # access_log /logs/nginx_domain_access; - - # location / { - # root /app; - # index override.html login.html; - # try_files $uri $uri/ =404; - # } - # location /adguard/ { - # access_log /logs/nginx_adguard_access; - # proxy_pass http://ad:80/; - # proxy_redirect / /adguard/; - # proxy_cookie_path / /adguard/; - # } - # location /webapp { - # access_log /logs/nginx_webapp_access; - # alias /app; - # index index.html; - # try_files $uri $uri/ /pac?$query_string; - # } - # location /pac { - # access_log /logs/nginx_pac_access; - # proxy_set_header Host $http_host; - # proxy_pass http://php; - # } - # location ~\.well-known { - # access_log /logs/nginx_certbot_access; - # root /certs/; - # try_files $uri =404; - # } - # 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; - # } -#-domain -#-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 -#-domain - # } -#-domain }