{"id":36609,"date":"2020-02-25T19:50:53","date_gmt":"2020-02-25T11:50:53","guid":{"rendered":"http:\/\/4563.org\/?p=36609"},"modified":"2020-02-25T19:50:53","modified_gmt":"2020-02-25T11:50:53","slug":"nginx-5hadowsocs-libev-v2ray-plugin","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=36609","title":{"rendered":"Nginx + 5hadowsocs-libev + v2ray-plugin"},"content":{"rendered":"\n<p>  \t\t\t\t\t<strong>Renzheng<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3>Nginx + 5hadowsocs-libev + v2ray-plugin<\/h3>\n<p>  \t\t \u672c\u5e16\u6700\u540e\u7531 Renzheng \u4e8e 2020-2-25 20:01 \u7f16\u8f91 <\/p>\n<p> \u4eca\u5929\u5c1d\u8bd5\u4f7f\u7528 Nginx \u53cd\u5411\u4ee3\u7406 shadowsocks-libev + v2ray-plugin \u5b9e\u73b0\u5206\u6d41\uff0c\u4f7f\u5f97\u7f51\u7ad9\u548c v2ray-plugin \u5171\u5b58\uff0c\u4f46\u662f\u597d\u50cf\u914d\u7f6e\u5931\u8d25\u4e86\uff0c\u4e00\u76f4\u8fde\u4e0d\u4e0a\u3002\u5728\u8fd9\u91cc\u95ee\u95ee\u5404\u4f4d\u5927\u4f6c\u5230\u5e95\u662f\u54ea\u91cc\u51fa\u4e86\u95ee\u9898\uff1f\u8c22\u8c22<\/p>\n<p>  \u65e0\u9700\u63a8\u8350 v2ray \u4e86\uff0c \u8fd9\u548c v2ray \u7684 WebSocket+TLS+Web \u5982\u51fa\u4e00\u8f99\u3002\u673a\u573a\u4e5f\u5c31\u522b\u6765\u6253\u5e7f\u544a\u4e86\u3002<\/p>\n<p>  shadowsocks-libev \u914d\u7f6e\u6587\u4ef6<\/p>\n<p>  root@iZt4ngiff6xe6fa04n7ew4Z:~# cat \/etc\/shadowsocks-libev\/config.json <br \/>  {<br \/>  &nbsp; &nbsp; &quot;server&quot;:&quot;0.0.0.0&quot;,<br \/>  &nbsp; &nbsp; &quot;server_port&quot;:8443,<br \/>  &nbsp; &nbsp; &quot;password&quot;:&quot;password&quot;,<br \/>  &nbsp; &nbsp; &quot;timeout&quot;:300,<br \/>  &nbsp; &nbsp; &quot;user&quot;:&quot;nobody&quot;,<br \/>  &nbsp; &nbsp; &quot;method&quot;:&quot;chacha20-ietf-poly1305&quot;,<br \/>  &nbsp; &nbsp; &quot;fast_open&quot;:false,<br \/>  &nbsp; &nbsp; &quot;nameserver&quot;:&quot;8.8.8.8&quot;,<br \/>  &nbsp; &nbsp; &quot;mode&quot;:&quot;tcp_and_udp&quot;,<br \/>  &nbsp; &nbsp; &quot;plugin&quot;:&quot;v2ray-plugin&quot;,<br \/>  &nbsp; &nbsp; &quot;plugin_opts&quot;:&quot;server;path=\/image;loglevel=none&quot;<br \/>  }<\/p>\n<p>  nginx \u914d\u7f6e\u6587\u4ef6\uff0c\u57df\u540d\u5df2\u7ecf\u4f7f\u7528 example.com \u66ff\u4ee3\u4e86\u3002<\/p>\n<p>  root@iZt4ngiff6xe6fa04n7ew4Z:~# cat \/usr\/local\/nginx\/conf\/vhost\/example.com.conf <br \/>  server<br \/>  &nbsp; &nbsp; {<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;listen 80;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;#listen [::]:80;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;server_name example.com;<br \/>  &nbsp; &nbsp; <br \/>  &nbsp; &nbsp;&nbsp; &nbsp;return 301 https:\/\/example.com$request_uri;<br \/>  &nbsp; &nbsp; }<\/p>\n<p>  server<br \/>  &nbsp; &nbsp; {<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;listen 443 ssl http2;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;#listen [::]:443 ssl http2;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;server_name example.com ;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;index index.html index.htm index.php default.html default.htm default.php;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;root\/home\/wwwroot\/example.com;<\/p>\n<p>  &nbsp; &nbsp;&nbsp; &nbsp;ssl_certificate \/usr\/local\/nginx\/conf\/ssl\/example.com\/fullchain.pem;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;ssl_certificate_key \/usr\/local\/nginx\/conf\/ssl\/example.com\/private.key;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;ssl_session_timeout 5m;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;ssl_prefer_server_ciphers on;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;ssl_ciphers &quot;TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256:EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5&quot;;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;ssl_session_cache builtin:1000 shared:SSL:10m;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;# openssl dhparam -out \/usr\/local\/nginx\/conf\/ssl\/dhparam.pem 2048<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;ssl_dhparam \/usr\/local\/nginx\/conf\/ssl\/dhparam.pem;<\/p>\n<p>  &nbsp; &nbsp;&nbsp; &nbsp;include rewrite\/typecho.conf;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;#error_page&nbsp; &nbsp;404&nbsp; &nbsp;\/404.html;<\/p>\n<p>  &nbsp; &nbsp;&nbsp; &nbsp;# Deny access to PHP files in specific directory<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;#location ~ \/(wp-content|uploads|wp-includes|images)\/.*.php$ { deny all; }<\/p>\n<p>  &nbsp; &nbsp;&nbsp; &nbsp;include enable-php-pathinfo.conf;<\/p>\n<p>  &nbsp; &nbsp;&nbsp; &nbsp;location \/image {<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;proxy_redirect off;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;proxy_http_version 1.1;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;proxy_pass http:\/\/127.0.0.1:8443;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;proxy_set_header Host $http_host;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;proxy_set_header Upgrade $http_upgrade;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;proxy_set_header Connection &quot;upgrade&quot;;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;}<\/p>\n<p>  &nbsp; &nbsp;&nbsp; &nbsp;location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;{<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;expires&nbsp; &nbsp;&nbsp; &nbsp;30d;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;}<\/p>\n<p>  &nbsp; &nbsp;&nbsp; &nbsp;location ~ .*.(js|css)?$<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;{<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;expires&nbsp; &nbsp;&nbsp; &nbsp;12h;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;}<\/p>\n<p>  &nbsp; &nbsp;&nbsp; &nbsp;location ~ \/.well-known {<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;allow all;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;}<\/p>\n<p>  &nbsp; &nbsp;&nbsp; &nbsp;location ~ \/.<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;{<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;deny all;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;}<\/p>\n<p>  &nbsp; &nbsp;&nbsp; &nbsp;access_log\/home\/wwwlogs\/example.com.log;<br \/>  &nbsp; &nbsp; }<\/p>\n<p>  \u672c\u5730\u5ba2\u6237\u7aef\u914d\u7f6e<\/p>\n<p>  https:\/\/i.loli.net\/2020\/02\/25\/ZJHyWkG4oIqEuv3.png<\/p>\n<p>  shadowsocks-libev status<\/p>\n<p>  https:\/\/i.loli.net\/2020\/02\/25\/DfuqNy6Zz1jcdbE.png<\/p>\n<p>  example.com \u8bbf\u95ee\u65e5\u5fd7<\/p>\n<p>  cat \/home\/wwwlogs\/example.com.log<\/p>\n<p>  https:\/\/i.loli.net\/2020\/02\/25\/ljEVg8HbYKJqSeN.png\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>Renzheng<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u5982\u679c\u628a Nginx \u5173\u95ed\uff0c\u5c06 shadowsocks \u6539\u7528 443\u7aef\u53e3\uff0c\u5373\u4f7f\u7528\u5982\u4e0b\u914d\u7f6e\u662f\u53ef\u4ee5\u4f7f\u7528\u7684\u3002<br \/>  {<br \/>  &nbsp; &nbsp; &quot;server&quot;:&quot;0.0.0.0&quot;,<br \/>  &nbsp; &nbsp; &quot;server_port&quot;:443,<br \/>  &nbsp; &nbsp; &quot;password&quot;:&quot;passsword&quot;,<br \/>  &nbsp; &nbsp; &quot;timeout&quot;:300,<br \/>  &nbsp; &nbsp; &quot;user&quot;:&quot;nobody&quot;,<br \/>  &nbsp; &nbsp; &quot;method&quot;:&quot;chacha20-ietf-poly1305&quot;,<br \/>  &nbsp; &nbsp; &quot;fast_open&quot;:false,<br \/>  &nbsp; &nbsp; &quot;nameserver&quot;:&quot;8.8.8.8&quot;,<br \/>  &nbsp; &nbsp; &quot;mode&quot;:&quot;tcp_and_udp&quot;,<br \/>  &nbsp; &nbsp; &quot;plugin&quot;: &quot;v2ray-plugin&quot;,<br \/>  &nbsp; &nbsp; &quot;plugin_opts&quot;: &quot;server;tls;host=example.com;cert=\/usr\/local\/nginx\/conf\/ssl\/example.com\/fullchain.cer;key=\/usr\/local\/nginx\/conf\/ssl\/example.com\/example.com.key&quot;<br \/>  }  \t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u4e09\u4e0d<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u4f60\u8981\u642d\u5efa\u8fd9\u4e48\u590d\u6742\u7684\u505a\u4ec0\u4e48\uff1f\u7b7e\u540d\u7701\u5fc3\u5427\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>kfen<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u7701\u7701\u5427\uff0c\u4f60\u8fd9\u6837\u6298\u817e\u6765\u6298\u817e\u53bb\u8fd8\u4e0d\u5982\u76f4\u63a5\u4e0a\u539f\u7248V2\uff1f \u5927\u4f6c\u6559\u7a0b\u4e5f\u591a\u7684\u662f\u3002\u3002\u3002:lol:lol:lol:lol:lol:lol\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>Renzheng<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u4e09\u4e0d \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-2-25 19:53<br \/>  \u4f60\u8981\u642d\u5efa\u8fd9\u4e48\u590d\u6742\u7684\u505a\u4ec0\u4e48\uff1f\u7b7e\u540d\u7701\u5fc3\u5427<\/p>\n<p> \u8fd9\u6837\u66f4\u52a0\u5b89\u5168\u5450\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u830e\u809b\u4e92\u64b8\u5a03<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u4e09\u4e0d \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-2-25 19:53<br \/>  \u4f60\u8981\u642d\u5efa\u8fd9\u4e48\u590d\u6742\u7684\u505a\u4ec0\u4e48\uff1f\u7b7e\u540d\u7701\u5fc3\u5427<\/p>\n<p> \u673a\u573a\u662f\u81ea\u5df1\u7684\u6302\u4e86\uff0c\u5e94\u6025\u7528\u4f46\u662f\u6211\u5df2\u7ecf\u7528\u673a\u573a\u5df2\u7ecf\u4e00\u4e2a\u6708\u4e86\u8fd8\u771f\u7684\u4e0d\u9519yc010t\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>rockyou<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u4e3a\u6bdb\u4e0d\u76f4\u63a5\u4e0aV2\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>Renzheng<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\trockyou \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-2-25 19:58<br \/>  \u4e3a\u6bdb\u4e0d\u76f4\u63a5\u4e0aV2<\/p>\n<p> \u56e0\u4e3a v2ray \u7684WebSocket+TLS+Web \u4e5f\u662f\u8fd9\u4e48\u914d\u7f6e\u7684\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>allen3201<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>   &quot;server&quot;:&quot;127.0.0.1&quot;,<br \/>  \u8bd5\u8bd5\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u7115123<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u6e90\u7ad9\u7684nginx\u76d1\u542c\u4e00\u4e0bip\u8bd5\u8bd5\u770b\t\t\t  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Renzheng \u5927\u4f6c\u6709\u8bdd\u8bf4 : &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/36609"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=36609"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/36609\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=36609"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=36609"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=36609"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}