{"id":44,"date":"2023-07-30T17:52:20","date_gmt":"2023-07-30T09:52:20","guid":{"rendered":"https:\/\/jjm6.com\/?p=44"},"modified":"2023-07-30T17:52:20","modified_gmt":"2023-07-30T09:52:20","slug":"xrayr%e5%90%8e%e7%ab%af%e7%9a%84tls%e4%ba%a4%e7%bb%99nginx%e5%a4%84%e7%90%86%e7%9a%84%e9%85%8d%e7%bd%ae","status":"publish","type":"post","link":"https:\/\/jjm6.com\/index.php\/2023\/07\/30\/xrayr%e5%90%8e%e7%ab%af%e7%9a%84tls%e4%ba%a4%e7%bb%99nginx%e5%a4%84%e7%90%86%e7%9a%84%e9%85%8d%e7%bd%ae\/","title":{"rendered":"<a href=\"https:\/\/lala.im\/7867.html\">XrayR\u540e\u7aef\u7684TLS\u4ea4\u7ed9Nginx\u5904\u7406\u7684\u914d\u7f6e<\/a>"},"content":{"rendered":"\n<p>\u5728\u4e4b\u524d\u6211\u8bb0\u5f55\u4e86\u4e00\u4e0bxrayr\u540e\u7aef\u8282\u70b9\u7684\u5e38\u7528\u914d\u7f6e\u65b9\u6cd5\uff0c\u5728\u8fd9\u79cd\u65b9\u6cd5\u4e0b\uff0ctls\u662f\u76f4\u63a5\u7531xrayr\u5904\u7406\u7684\uff0c\u8fd9\u6837\u4e00\u6765\u4f1a\u6709\u4e00\u4e9b\u95ee\u9898\u3002<\/p>\n\n\n\n<p>\u9996\u5148\u4e3a\u4e86\u907f\u514d\u673a\u5668\u88ab\u5899\uff0c\u73b0\u5728\u65e0\u4e00\u4f8b\u5916\u80af\u5b9a\u662f\u4f7f\u7528vmess+websocket+tls\u6216\u8005vless+xtls\uff08xrayr\u662f\u652f\u6301\u7684\uff09<\/p>\n\n\n\n<p>\u4f46\u65e0\u8bba\u4f60\u4f7f\u7528\u4e0a\u9762\u63d0\u5230\u7684\u8fd9\u4e24\u79cd\u65b9\u6cd5\u7684\u54ea\u4e00\u79cd\uff0c\u90fd\u662f\u975e\u5e38\u4f9d\u8d56443\u7aef\u53e3\u7684\uff0c\u5982\u679c\u8ba9xrayr\u76f4\u63a5\u76d1\u542c443\u7684\u8bdd\uff0c\u673a\u5668\u5c31\u4e0d\u80fd\u518d\u505a\u5176\u4ed6\u4e8b\u60c5\u4e86\u3002\u6bd4\u5982\u7528nginx\u6216\u8005caddy\u5efa\u7ad9\u5c31\u4e0d\u80fdhttps\u4e86\u3002<\/p>\n\n\n\n<p>\u7528\u5176\u4ed6\u7aef\u53e3\u914d\u7f6e\u5427\uff0c\u53c8\u663e\u5f97\u6709\u70b9\u4e0d\u4f26\u4e0d\u7c7b\u3002\u6240\u4ee5\u6700\u597d\u7684\u529e\u6cd5\u662f\u8ba9nginx\u6765\u5904\u7406tls\uff0c\u8fd9\u6837443\u7aef\u53e3\u5c31\u53ef\u4ee5\u817e\u51fa\u6765\u7ed9nginx\u7528\u4e86\u3002<\/p>\n\n\n\n<p>vless+xtls\u5176\u5b9e\u662f\u76ee\u524d\u66f4\u63a8\u8350\u7684\u914d\u7f6e\u65b9\u6cd5\uff0c\u4f46\u662f\u76ee\u524dv2board\u9762\u677f\u7684\u8ba2\u9605\u8fd8\u4e0d\u652f\u6301\uff0c\u6240\u4ee5\u4e0b\u9762\u6211\u5c31\u7528vmess+websocket+tls\u6765\u6f14\u793a\u4e00\u4e0b\u914d\u7f6e\u3002<\/p>\n\n\n\n<p>\u9996\u5148\u5728\u8282\u70b9\u4e0a\u5b89\u88c5\u9700\u8981\u7528\u5230\u7684\u5305\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt -y update\napt -y install nginx python-certbot-nginx supervisor<\/pre>\n\n\n\n<p>\u542f\u52a8\u670d\u52a1\u5e76\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">systemctl enable --now nginx supervisor<\/pre>\n\n\n\n<p>\u63a5\u7740\u5728v2board\u9762\u677f\u5185\u6dfb\u52a0\u4e00\u4e2awebsocket\u8282\u70b9\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/lala.im\/wp-content\/uploads\/2021\/05\/lala.im_2021-05-08_20-28-59.png\"><img decoding=\"async\" src=\"https:\/\/lala.im\/wp-content\/uploads\/2021\/05\/lala.im_2021-05-08_20-28-59.png\" alt=\"\" class=\"wp-image-7868\"\/><\/a><\/figure>\n\n\n\n<p>\u6ce8\u610f\u8fd9\u91cc\u7684\u8fde\u63a5\u7aef\u53e3\u548c\u670d\u52a1\u7aef\u53e3\uff0c\u8fde\u63a5\u7aef\u53e3\u914d\u7f6e\u4e3a443\uff0c\u670d\u52a1\u7aef\u53e3\u914d\u7f6e\u4e3a4443\u3002<\/p>\n\n\n\n<p>\u8fde\u63a5\u7aef\u53e3\u5c31\u76f8\u5f53\u4e8e\u662f\u7528\u6237\u901a\u8fc7\u8ba2\u9605\u8fde\u63a5\u914d\u7f6e\u5728\u5ba2\u6237\u7aef\u4e0a\u7684\u7aef\u53e3\uff0c\u800c\u670d\u52a1\u7aef\u53e3\u662fxrayr\u540e\u7aef\u5b9e\u9645\u76d1\u542c\u7684\u7aef\u53e3\u3002<\/p>\n\n\n\n<p>\u53e6\u5916\u522b\u5fd8\u4e86\u914d\u7f6epath\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/lala.im\/wp-content\/uploads\/2021\/05\/lala.im_2021-05-08_20-41-20.png\"><img decoding=\"async\" src=\"https:\/\/lala.im\/wp-content\/uploads\/2021\/05\/lala.im_2021-05-08_20-41-20.png\" alt=\"\" class=\"wp-image-7869\"\/><\/a><\/figure>\n\n\n\n<p>\u73b0\u5728\u65b0\u5efa\u4e00\u4e2anginx\u7ad9\u70b9\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">nano \/etc\/nginx\/conf.d\/xrayr.conf<\/pre>\n\n\n\n<p>\u5199\u5165\u5982\u4e0b\u914d\u7f6e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">server {\n    listen       80;\n    server_name  rucn2.ohshit.club;\n\n    location \/sometimesnaive {\n        proxy_pass                       http:\/\/127.0.0.1:4443;\n        proxy_redirect                   off;\n        proxy_http_version               1.1;\n        proxy_set_header Upgrade         $http_upgrade;\n        proxy_set_header Connection      \"upgrade\";\n        proxy_set_header Host            $http_host;\n        proxy_set_header X-Real-IP       $remote_addr;\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n    }\n}<\/pre>\n\n\n\n<p>\u5269\u4e0b\u7ed9nginx\u914d\u7f6essl\u8bc1\u4e66\u7684\u8fd9\u4e9b\u6b65\u9aa4\u5168\u90e8\u4ea4\u7ed9certbot\u81ea\u52a8\u5e2e\u6211\u4eec\u5904\u7406\u5373\u53ef\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">certbot --nginx<\/pre>\n\n\n\n<p>\u73b0\u5728\u5b89\u88c5xrayr\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mkdir \/opt\/xrayr &amp;&amp; cd \/opt\/xrayr\nwget https:\/\/github.com\/XrayR-project\/XrayR\/releases\/download\/v0.5.0\/XrayR-linux-64.zip<\/pre>\n\n\n\n<p>\u7f16\u8f91xrayr\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">nano config.yml<\/pre>\n\n\n\n<p>\u6539\u4e3a\u5982\u4e0b\u914d\u7f6e\uff0c\u91cd\u8981\u90e8\u5206\u5199\u4e86\u6ce8\u91ca\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Log:\n  Level: debug\n  AccessPath: .\/access.log\n  ErrorPath: .\/error.log\nDnsConfigPath: .\/dns.json\nNodes:\n  -\n    PanelType: \"V2board\"\n    ApiConfig:\n      ApiHost: \"https:\/\/v2board.ohshit.club\/\"\n      ApiKey: \"imlalaimlalaimlala\"\n      NodeID: 4 \/\/ \u5bf9\u5e94v2board\u9762\u677f\u5185\u7684\u8282\u70b9id\n      NodeType: V2ray\n      Timeout: 30\n      EnableVless: false\n      EnableXTLS: false\n    ControllerConfig:\n      ListenIP: 127.0.0.1 \/\/ \u4ec5\u76d1\u542c\u5728\u672c\u5730\n      UpdatePeriodic: 60\n      EnableDNS: false\n      CertConfig:\n        CertMode: none \/\/ \u5173\u95ed\u8bc1\u4e66\u7533\u8bf7\n        CertDomain: \"rucn2.ohshit.club\" \n        Provider: cloudflare \n        Email: example@lala.im\n        DNSEnv: \n          CF_DNS_API_TOKEN: cwPZEBAvIXUcxCdy4v2ib5j8uK-KwnRMDuNPxE-n<\/pre>\n\n\n\n<p>\u65b0\u5efasupervisor\u914d\u7f6e\u6587\u4ef6\u7528\u4e8e\u5b88\u62a4xrayr\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">nano \/etc\/supervisor\/conf.d\/xrayr.conf<\/pre>\n\n\n\n<p>\u5199\u5165\u5982\u4e0b\u914d\u7f6e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">[program:xrayr]\ndirectory=\/opt\/xrayr\ncommand=\/opt\/xrayr\/XrayR -config config.yml\nautostart=true\nautorestart=true<\/pre>\n\n\n\n<p>\u542f\u52a8xrayr\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">supervisorctl update<\/pre>\n\n\n\n<p>\u81f3\u6b64\u914d\u7f6e\u5c31\u5168\u90e8\u5b8c\u6210\u4e86\u3002\u5bf9\u63a5\u6709\u4efb\u4f55\u95ee\u9898\uff0c\u67e5\u770b\u76f8\u5e94\u7684\u65e5\u5fd7\u6587\u4ef6\u6709\u52a9\u4e8e\u6392\u9519\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/opt\/xrayr\/access.log\n\/opt\/xrayr\/error.log<\/pre>\n\n\n\n<h2>\u4e0b\u9762\u662f\u6211\u81ea\u5df1\u7684\u914d\u7f6e\uff1a<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">server {\n    server_name  s**.jjm6.com;\n\n    location \/allgood {\n        proxy_pass                       http:\/\/127.0.0.1:14431;\n        proxy_redirect                   off;\n        proxy_http_version               1.1;\n        proxy_set_header Upgrade         $http_upgrade;\n        proxy_set_header Connection      \"upgrade\";\n        proxy_set_header Host            $http_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    listen 443 ssl; <em># managed by Certbot<\/em>\n    ssl_certificate \/etc\/letsencrypt\/live\/sgp.jjm6.com\/fullchain.pem; <em># managed by Certbot<\/em>\n    ssl_certificate_key \/etc\/letsencrypt\/live\/sgp.jjm6.com\/privkey.pem; <em># managed by Certbot<\/em>\n    include \/etc\/letsencrypt\/options-ssl-nginx.conf; <em># managed by Certbot<\/em>\n    ssl_dhparam \/etc\/letsencrypt\/ssl-dhparams.pem; <em># managed by Certbot<\/em>\n\n}server {\n    <strong>if<\/strong> ($host = sgp.jjm6.com) {\n        return 301 https:\/\/$host$request_uri;\n    } <em># managed by Certbot<\/em>\n\n\n    listen       80;\n    server_name  sgp.jjm6.com;\n    return 404; <em># managed by Certbot<\/em>\n\n\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u4e4b\u524d\u6211\u8bb0\u5f55\u4e86\u4e00\u4e0bxrayr\u540e\u7aef\u8282\u70b9\u7684\u5e38\u7528\u914d\u7f6e\u65b9\u6cd5\uff0c\u5728\u8fd9\u79cd\u65b9\u6cd5\u4e0b\uff0ctls\u662f\u76f4\u63a5\u7531xrayr\u5904\u7406\u7684\uff0c\u8fd9\u6837\u4e00\u6765\u4f1a\u6709 &hellip; <a href=\"https:\/\/jjm6.com\/index.php\/2023\/07\/30\/xrayr%e5%90%8e%e7%ab%af%e7%9a%84tls%e4%ba%a4%e7%bb%99nginx%e5%a4%84%e7%90%86%e7%9a%84%e9%85%8d%e7%bd%ae\/\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201c<a href=\"https:\/\/lala.im\/7867.html\">XrayR\u540e\u7aef\u7684TLS\u4ea4\u7ed9Nginx\u5904\u7406\u7684\u914d\u7f6e<\/a>\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/jjm6.com\/index.php\/wp-json\/wp\/v2\/posts\/44"}],"collection":[{"href":"https:\/\/jjm6.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jjm6.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jjm6.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jjm6.com\/index.php\/wp-json\/wp\/v2\/comments?post=44"}],"version-history":[{"count":1,"href":"https:\/\/jjm6.com\/index.php\/wp-json\/wp\/v2\/posts\/44\/revisions"}],"predecessor-version":[{"id":45,"href":"https:\/\/jjm6.com\/index.php\/wp-json\/wp\/v2\/posts\/44\/revisions\/45"}],"wp:attachment":[{"href":"https:\/\/jjm6.com\/index.php\/wp-json\/wp\/v2\/media?parent=44"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jjm6.com\/index.php\/wp-json\/wp\/v2\/categories?post=44"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jjm6.com\/index.php\/wp-json\/wp\/v2\/tags?post=44"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}