{"id":34,"date":"2022-07-16T16:33:43","date_gmt":"2022-07-16T08:33:43","guid":{"rendered":"https:\/\/bt.079300.xyz\/?p=34"},"modified":"2022-07-16T16:33:43","modified_gmt":"2022-07-16T08:33:43","slug":"nginx%e5%ae%89%e8%a3%85%e9%85%8d%e7%bd%ae%e3%80%81bbr%e7%ae%97%e6%b3%95%e5%88%87%e6%8d%a2","status":"publish","type":"post","link":"https:\/\/bt.079300.xyz\/index.php\/2022\/07\/16\/nginx%e5%ae%89%e8%a3%85%e9%85%8d%e7%bd%ae%e3%80%81bbr%e7%ae%97%e6%b3%95%e5%88%87%e6%8d%a2\/","title":{"rendered":"nginx\u5b89\u88c5\u914d\u7f6e\u3001BBR\u7b97\u6cd5\u5207\u6362"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code># \u5b89\u88c5nginx\uff1a\napt install nginx\n# \u914d\u7f6enginx\uff1a\nvim \/etc\/nginx\/nginx.conf\n# \u91cd\u65b0\u52a0\u8f7dnginx\u914d\u7f6e\uff1a\nsystemctl reload nginx.service<\/code><\/pre>\n\n\n\n<p><strong>nginx\u914d\u7f6e\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>user www-data;\nworker_processes auto;\npid \/run\/nginx.pid;\ninclude \/etc\/nginx\/modules-enabled\/*.conf;\n\nevents {\n  worker_connections 768;\n}\n\nhttp {\n\n server {\n    listen 80 default_server;\n    listen &#91;::]:80 default_server;\n\n   ssl_protocols         TLSv1.2 TLSv1.3;\n   ssl_ciphers           ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;\n   ssl_prefer_server_ciphers off;\nlocation \/ {\n  proxy_pass https:\/\/www.bing.com; #\u4f2a\u88c5\u7f51\u5740\n  proxy_ssl_server_name on;\n  proxy_redirect off;\n  sub_filter_once off;\n  sub_filter \"www.bing.com\" $server_name;\n  proxy_set_header Host \"www.bing.com\";\n  proxy_set_header Referer $http_referer;\n  proxy_set_header X-Real-IP $remote_addr;\n  proxy_set_header User-Agent $http_user_agent;\n  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n  proxy_set_header X-Forwarded-Proto https;\n  proxy_set_header Accept-Encoding \"\";\n  proxy_set_header Accept-Language \"zh-CN\";\n    }\n\n   location \/ray {\n    proxy_redirect off;\n    proxy_pass http:\/\/127.0.0.1:8388;\n    proxy_http_version 1.1;\n    proxy_set_header Upgrade $http_upgrade;\n    proxy_set_header Connection \"upgrade\";\n    proxy_set_header Host $host;\n    proxy_set_header X-Real-IP $remote_addr;\n    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n    }\n\n   location \/xui {\n    proxy_redirect off;\n    proxy_pass http:\/\/127.0.0.1:9999;\n    proxy_http_version 1.1;\n    proxy_set_header Host $host;\n   }\n }\n}<\/code><\/pre>\n\n\n\n<p><strong>\u62e5\u585e\u63a7\u5236\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#\u67e5\u8be2\u5f53\u524d\u4f7f\u7528\u7684 TCP \u62e5\u585e\u63a7\u5236\u7b97\u6cd5\nsysctl net.ipv4.tcp_congestion_control\n#\u67e5\u8be2\u5f53\u524dLinux\u7248\u672c\nuname -r\n\n#\u542f\u7528BBR TCP\u62e5\u585e\u63a7\u5236\u7b97\u6cd5\necho \"net.core.default_qdisc=fq\" &gt;&gt; \/etc\/sysctl.conf\necho \"net.ipv4.tcp_congestion_control=bbr\" &gt;&gt; \/etc\/sysctl.conf\nsysctl -p<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>nginx\u914d\u7f6e\uff1a \u62e5\u585e\u63a7\u5236\uff1a<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-34","post","type-post","status-publish","format-standard","hentry","category-uncategorized","entry"],"_links":{"self":[{"href":"https:\/\/bt.079300.xyz\/index.php\/wp-json\/wp\/v2\/posts\/34","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bt.079300.xyz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bt.079300.xyz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bt.079300.xyz\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bt.079300.xyz\/index.php\/wp-json\/wp\/v2\/comments?post=34"}],"version-history":[{"count":1,"href":"https:\/\/bt.079300.xyz\/index.php\/wp-json\/wp\/v2\/posts\/34\/revisions"}],"predecessor-version":[{"id":35,"href":"https:\/\/bt.079300.xyz\/index.php\/wp-json\/wp\/v2\/posts\/34\/revisions\/35"}],"wp:attachment":[{"href":"https:\/\/bt.079300.xyz\/index.php\/wp-json\/wp\/v2\/media?parent=34"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bt.079300.xyz\/index.php\/wp-json\/wp\/v2\/categories?post=34"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bt.079300.xyz\/index.php\/wp-json\/wp\/v2\/tags?post=34"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}