88 lines
3.2 KiB
Text
88 lines
3.2 KiB
Text
location /net-cgi {
|
|
|
|
location /net-cgi/trace {
|
|
default_type text/plain;
|
|
|
|
set $http_ver 'h1.1';
|
|
if ($http2) {
|
|
set $http_ver $http2;
|
|
}
|
|
if ($http3) {
|
|
set $http_ver $http3;
|
|
}
|
|
|
|
set $trace '';
|
|
set $trace '${trace}req:id = $request_id\n';
|
|
set $trace '${trace}req:v = $http_ver\n';
|
|
set $trace '${trace}dst:host = $hostname\n';
|
|
set $trace '${trace}src:addr = $remote_addr\n';
|
|
set $trace '${trace}src:ua = $http_user_agent\n';
|
|
if ($http_sec_ch_ua) {
|
|
set $trace '${trace}src:ua:ch = $http_sec_ch_ua\n';
|
|
set $trace '${trace}src:ua:ch:mobile = $http_sec_ch_ua_mobile\n';
|
|
set $trace '${trace}src:ua:ch:pf = $http_sec_ch_ua_platform\n';
|
|
}
|
|
if ($http_sec_ch_ua_arch) {
|
|
set $trace '${trace}src:ua:ch:arch = $http_sec_ch_ua_arch\n';
|
|
set $trace '${trace}src:ua:ch:bit = $http_sec_ch_ua_bitness\n';
|
|
set $trace '${trace}src:ua:ch:form = $http_sec_ch_ua_form_factors\n';
|
|
set $trace '${trace}src:ua:ch:full = $http_sec_ch_ua_full_version\n';
|
|
set $trace '${trace}src:ua:ch:full:ls = $http_sec_ch_ua_full_version_list\n';
|
|
set $trace '${trace}src:ua:ch:model = $http_sec_ch_ua_model\n';
|
|
set $trace '${trace}src:ua:ch:pf:v = $http_sec_ch_ua_platform_version\n';
|
|
set $trace '${trace}src:ua:ch:wow64 = $http_sec_ch_ua_wow64\n';
|
|
}
|
|
if ($http_cf_ipcountry) {
|
|
set $trace '${trace}src:geo = $http_cf_ipcountry\n';
|
|
}
|
|
if ($remote_addr != $realip_remote_addr) {
|
|
set $trace '${trace}pxy:addr = $realip_remote_addr\n';
|
|
}
|
|
set $trace '${trace}pxy:xf:for = $http_x_forwarded_for\n';
|
|
set $trace '${trace}pxy:xf:proto = $http_x_forwarded_proto\n';
|
|
if ($http_cf_ray) {
|
|
set $trace '${trace}pxy:cf:ray = $http_cf_ray\n';
|
|
set $trace '${trace}pxy:cf:for = $http_cf_connecting_ip\n';
|
|
}
|
|
|
|
return 200 '${trace}';
|
|
}
|
|
|
|
location /net-cgi/ua-ch {
|
|
add_header Accept-CH 'Sec-CH-UA-Arch, Sec-CH-UA-Bitness, Sec-CH-UA-Form-Factors, Sec-CH-UA-Full-Version, Sec-CH-UA-Full-Version-List, Sec-CH-UA-Mobile, Sec-CH-UA-Model, Sec-CH-UA-Platform, Sec-CH-UA-Platform-Version, Sec-CH-UA-WoW64' always;
|
|
|
|
return 307 'https://${host}/net-cgi/trace';
|
|
}
|
|
|
|
location /net-cgi/embed {
|
|
default_type text/html;
|
|
|
|
set $html '';
|
|
set $html '${html}<html><head>\n';
|
|
set $html '${html} <title>$remote_addr --> $hostname</title>\n';
|
|
set $html '${html} <meta\n';
|
|
set $html '${html} property="og:title"\n';
|
|
set $html '${html} content="$remote_addr --> $hostname"\n';
|
|
set $html '${html} />\n';
|
|
set $html '${html} <meta\n';
|
|
set $html '${html} property="og:description"\n';
|
|
set $html '${html} content="';
|
|
set $html '${html}ua = $http_user_agent';
|
|
if ($http_cf_ray) {
|
|
set $html '${html}\nray = $http_cf_ray';
|
|
}
|
|
set $html '${html}"\n />\n';
|
|
set $html '${html} <meta\n';
|
|
set $html '${html} http-equiv="refresh"\n';
|
|
set $html '${html} content="0;url=https://$host/net-cgi/trace"\n';
|
|
set $html '${html} />\n';
|
|
set $html '${html}</head></html>';
|
|
|
|
return 200 '${html}';
|
|
}
|
|
|
|
add_header 'Access-Control-Allow-Origin' '*';
|
|
add_header 'Access-Control-Max-Age' '1728000';
|
|
add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS';
|
|
|
|
}
|