payload: {"action":"created","issue":{"url":"https://api.github.com/repos/v2ray/discussion/issues/268","repository_url":"https://api.github.com/repos/v2ray/discussion","labels_url":"https://api.github.com/repos/v2ray/discussion/issues/268/labels{/name}","comments_url":"https://api.github.com/repos/v2ray/discussion/issues/268/comments","events_url":"https://api.github.com/repos/v2ray/discussion/issues/268/events","html_url":"https://github.com/v2ray/discussion/issues/268","id":459865021,"node_id":"MDU6SXNzdWU0NTk4NjUwMjE=","number":268,"title":"gcp 中nginx/caddy反代无法传给v2ray，求大神帮忙看下","user":{"login":"dangelization","id":13503950,"node_id":"MDQ6VXNlcjEzNTAzOTUw","avatar_url":"https://avatars1.githubusercontent.com/u/13503950?v=4","gravatar_id":"","url":"https://api.github.com/users/dangelization","html_url":"https://github.com/dangelization","followers_url":"https://api.github.com/users/dangelization/followers","following_url":"https://api.github.com/users/dangelization/following{/other_user}","gists_url":"https://api.github.com/users/dangelization/gists{/gist_id}","starred_url":"https://api.github.com/users/dangelization/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dangelization/subscriptions","organizations_url":"https://api.github.com/users/dangelization/orgs","repos_url":"https://api.github.com/users/dangelization/repos","events_url":"https://api.github.com/users/dangelization/events{/privacy}","received_events_url":"https://api.github.com/users/dangelization/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2019-06-24T12:32:26Z","updated_at":"2019-12-11T13:23:44Z","closed_at":null,"author_association":"NONE","body":"整体配置是一个vmess+ws+真tls+nginx反代+cdn的配置\r\n\r\n具体问题是，v2ray客户端可以连接上nginx/caddy，查询nginx的access.log正常，但是反代传到v2ray的端口就没反应了，查询v2ray的access.log就什么都没有。\r\n我这个配置在搬瓦工上就没问题，就是上了google cloud platform就不好使了。\r\n使用浏览器浏览网站页面没有问题，就是说nginx安装运行没问题（除了反代？？）。\r\n\r\nv2ray服务端配置：/etc/v2ray/conf.json\r\n\r\n\r\n{\r\n  \"log\" : {\r\n    \"access\": \"/var/log/v2ray/access.log\",\r\n    \"error\": \"/var/log/v2ray/error.log\",\r\n    \"loglevel\": \"debug\"\r\n  },\r\n  \"inbounds\": [\r\n    {\r\n        \"port\": 58762,\r\n\t\"listen\":\"127.0.0.1\",\r\n        \"protocol\": \"vmess\",\r\n        \"settings\": {\r\n          \"clients\": [\r\n            {\r\n              \"id\": \"**********\",\r\n              \"level\": 1,\r\n              \"alterId\": 64,\r\n              \"email\": \"************\"\r\n            }\r\n          ],\r\n\t\t  \"disableInsecureEncryption\": true\r\n        },\r\n        \"streamSettings\": {\r\n          \"network\": \"ws\",\r\n          \"security\": \"tls\",\r\n          \"tlsSettings\": {\r\n               \"serverName\": \"abc.xy\",\r\n               \"certificates\": [\r\n                   {\r\n                       \"usage\": \"encipherment\",\r\n                       \"certificateFile\": \"/etc/v2ray/v2ray.crt\",\r\n                       \"keyFile\": \"/etc/v2ray/v2ray.key\"\r\n                   }\r\n               ]\r\n           },\r\n          \"wsSettings\": {\r\n            \"path\": \"/vms\"\r\n          }\r\n        }\r\n    }\r\n  ],\r\n  \"outbounds\": [\r\n    {\r\n        \"protocol\": \"freedom\",\r\n        \"settings\": {}\r\n    },\r\n    {\r\n        \"protocol\": \"blackhole\",\r\n        \"settings\": {},\r\n        \"tag\": \"blocked\"\r\n    }\r\n  ],\r\n  \"routing\": {\r\n    \"strategy\": \"rules\",\r\n    \"settings\": {\r\n      \"rules\": [\r\n        {\r\n          \"type\": \"field\",\r\n          \"ip\": [\r\n            \"0.0.0.0/8\",\r\n            \"10.0.0.0/8\",\r\n            \"100.64.0.0/10\",\r\n            \"127.0.0.0/8\",\r\n            \"169.254.0.0/16\",\r\n            \"172.16.0.0/12\",\r\n            \"192.0.0.0/24\",\r\n            \"192.0.2.0/24\",\r\n            \"192.168.0.0/16\",\r\n            \"198.18.0.0/15\",\r\n            \"198.51.100.0/24\",\r\n            \"203.0.113.0/24\",\r\n            \"::1/128\",\r\n            \"fc00::/7\",\r\n            \"fe80::/10\"\r\n          ],\r\n          \"outboundTag\": \"blocked\"\r\n        }\r\n      ]\r\n    }\r\n  }\r\n}\r\n\r\nnginx的conf：/etc/nginx/conf.d/mysite.conf\r\n\r\nserver {\r\n        listen 443 ssl http2;\r\n        ssl on;\r\n        ssl_certificate       /etc/v2ray/v2ray.crt;\r\n        ssl_certificate_key   /etc/v2ray/v2ray.key;\r\n        ssl_protocols         TLSv1 TLSv1.1 TLSv1.2;\r\n        ssl_ciphers           HIGH:!aNULL:!MD5;\r\n        server_name           abc.xy;\r\n        index index.html index.htm;\r\n        root  /www/;\r\n        error_page 400 = /400.html;\r\n        location /vms\r\n        {\r\n            proxy_redirect off;\r\n            proxy_pass http://127.0.0.1:58762;\r\n            proxy_http_version 1.1;\r\n            proxy_set_header Upgrade \\$http_upgrade;\r\n            proxy_set_header Connection \"upgrade\";\r\n            proxy_set_header Host \\$http_host;\r\n        }\r\n}\r\n\r\nserver {\r\n        listen 80;\r\n        server_name abc.xy www.abc.xy;\r\n        return 301 https://$server_name$request_uri;\r\n}\r\n\r\nv2ray的access.log：内容为空\r\nv2ray的error.log：\r\n2019/06/24 20:11:51 [Debug] v2ray.com/core/app/log: Logger started\r\n2019/06/24 20:11:51 [Warning] v2ray.com/core: V2Ray 4.19.1 started\r\n\r\nnginx的access.log：\r\n************** - - [24/Jun/2019:20:12:50 +0800] \"GET /vms HTTP/1.1\" 301 185 \"-\" \"Go-http-client/1.1\"\r\n************** - - [24/Jun/2019:20:12:50 +0800] \"GET /vms HTTP/1.1\" 301 185 \"-\" \"Go-http-client/1.1\"\r\n************** - - [24/Jun/2019:20:12:50 +0800] \"GET /vms HTTP/1.1\" 301 185 \"-\" \"Go-http-client/1.1\"\r\n************** - - [24/Jun/2019:20:12:51 +0800] \"GET /vms HTTP/1.1\" 301 185 \"-\" \"Go-http-client/1.1\"\r\n************** - - [24/Jun/2019:20:12:52 +0800] \"GET /vms HTTP/1.1\" 301 185 \"-\" \"Go-http-client/1.1\"\r\n************** - - [24/Jun/2019:20:12:54 +0800] \"GET /vms HTTP/1.1\" 301 185 \"-\" \"Go-http-client/1.1\"\r\n\r\nnginx的error.log：空\r\n\r\nroot@instance-3:/var/log/nginx# iptables -L -n\r\nChain INPUT (policy ACCEPT)\r\ntarget     prot opt source               destination\r\n\r\nChain FORWARD (policy ACCEPT)\r\ntarget     prot opt source               destination\r\nACCEPT     all  --  0.0.0.0/0            0.0.0.0/0\r\nACCEPT     all  --  0.0.0.0/0            0.0.0.0/0\r\n\r\nChain OUTPUT (policy ACCEPT)\r\ntarget     prot opt source               destination\r\n\r\nGCP的防火墙rules：\r\n<img width=\"606\" alt=\"捕获\" src=\"https://user-images.githubusercontent.com/13503950/60020057-ccc7a000-96c1-11e9-8235-0b58a530423f.PNG\">\r\n"},"comment":{"url":"https://api.github.com/repos/v2ray/discussion/issues/comments/564536986","html_url":"https://github.com/v2ray/discussion/issues/268#issuecomment-564536986","issue_url":"https://api.github.com/repos/v2ray/discussion/issues/268","id":564536986,"node_id":"MDEyOklzc3VlQ29tbWVudDU2NDUzNjk4Ng==","user":{"login":"johnrosen1","id":48143913,"node_id":"MDQ6VXNlcjQ4MTQzOTEz","avatar_url":"https://avatars1.githubusercontent.com/u/48143913?v=4","gravatar_id":"","url":"https://api.github.com/users/johnrosen1","html_url":"https://github.com/johnrosen1","followers_url":"https://api.github.com/users/johnrosen1/followers","following_url":"https://api.github.com/users/johnrosen1/following{/other_user}","gists_url":"https://api.github.com/users/johnrosen1/gists{/gist_id}","starred_url":"https://api.github.com/users/johnrosen1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnrosen1/subscriptions","organizations_url":"https://api.github.com/users/johnrosen1/orgs","repos_url":"https://api.github.com/users/johnrosen1/repos","events_url":"https://api.github.com/users/johnrosen1/events{/privacy}","received_events_url":"https://api.github.com/users/johnrosen1/received_events","type":"User","site_admin":false},"created_at":"2019-12-11T13:23:44Z","updated_at":"2019-12-11T13:23:44Z","author_association":"NONE","body":"> 整体配置是一个vmess+ws+真tls+nginx反代+cdn的配置\r\n> \r\n> 具体问题是，v2ray客户端可以连接上nginx/caddy，查询nginx的access.log正常，但是反代传到v2ray的端口就没反应了，查询v2ray的access.log就什么都没有。\r\n> 我这个配置在搬瓦工上就没问题，就是上了google cloud platform就不好使了。\r\n> 使用浏览器浏览网站页面没有问题，就是说nginx安装运行没问题（除了反代？？）。\r\n> \r\n> v2ray服务端配置：/etc/v2ray/conf.json\r\n> \r\n> {\r\n> \"log\" : {\r\n> \"access\": \"/var/log/v2ray/access.log\",\r\n> \"error\": \"/var/log/v2ray/error.log\",\r\n> \"loglevel\": \"debug\"\r\n> },\r\n> \"inbounds\": [\r\n> {\r\n> \"port\": 58762,\r\n> \"listen\":\"127.0.0.1\",\r\n> \"protocol\": \"vmess\",\r\n> \"settings\": {\r\n> \"clients\": [\r\n> {\r\n> \"id\": \"**********\", \"level\": 1, \"alterId\": 64, \"email\": \"************\"\r\n> }\r\n> ],\r\n> \"disableInsecureEncryption\": true\r\n> },\r\n> \"streamSettings\": {\r\n> \"network\": \"ws\",\r\n> \"security\": \"tls\",\r\n> \"tlsSettings\": {\r\n> \"serverName\": \"abc.xy\",\r\n> \"certificates\": [\r\n> {\r\n> \"usage\": \"encipherment\",\r\n> \"certificateFile\": \"/etc/v2ray/v2ray.crt\",\r\n> \"keyFile\": \"/etc/v2ray/v2ray.key\"\r\n> }\r\n> ]\r\n> },\r\n> \"wsSettings\": {\r\n> \"path\": \"/vms\"\r\n> }\r\n> }\r\n> }\r\n> ],\r\n> \"outbounds\": [\r\n> {\r\n> \"protocol\": \"freedom\",\r\n> \"settings\": {}\r\n> },\r\n> {\r\n> \"protocol\": \"blackhole\",\r\n> \"settings\": {},\r\n> \"tag\": \"blocked\"\r\n> }\r\n> ],\r\n> \"routing\": {\r\n> \"strategy\": \"rules\",\r\n> \"settings\": {\r\n> \"rules\": [\r\n> {\r\n> \"type\": \"field\",\r\n> \"ip\": [\r\n> \"0.0.0.0/8\",\r\n> \"10.0.0.0/8\",\r\n> \"100.64.0.0/10\",\r\n> \"127.0.0.0/8\",\r\n> \"169.254.0.0/16\",\r\n> \"172.16.0.0/12\",\r\n> \"192.0.0.0/24\",\r\n> \"192.0.2.0/24\",\r\n> \"192.168.0.0/16\",\r\n> \"198.18.0.0/15\",\r\n> \"198.51.100.0/24\",\r\n> \"203.0.113.0/24\",\r\n> \"::1/128\",\r\n> \"fc00::/7\",\r\n> \"fe80::/10\"\r\n> ],\r\n> \"outboundTag\": \"blocked\"\r\n> }\r\n> ]\r\n> }\r\n> }\r\n> }\r\n> \r\n> nginx的conf：/etc/nginx/conf.d/mysite.conf\r\n> \r\n> server {\r\n> listen 443 ssl http2;\r\n> ssl on;\r\n> ssl_certificate /etc/v2ray/v2ray.crt;\r\n> ssl_certificate_key /etc/v2ray/v2ray.key;\r\n> ssl_protocols TLSv1 TLSv1.1 TLSv1.2;\r\n> ssl_ciphers HIGH:!aNULL:!MD5;\r\n> server_name abc.xy;\r\n> index index.html index.htm;\r\n> root /www/;\r\n> error_page 400 = /400.html;\r\n> location /vms\r\n> {\r\n> proxy_redirect off;\r\n> proxy_pass http://127.0.0.1:58762;\r\n> proxy_http_version 1.1;\r\n> proxy_set_header Upgrade $http_upgrade;\r\n> proxy_set_header Connection \"upgrade\";\r\n> proxy_set_header Host $http_host;\r\n> }\r\n> }\r\n> \r\n> server {\r\n> listen 80;\r\n> server_name abc.xy [www.abc.xy](http://www.abc.xy);\r\n> return 301 https://$server_name$request_uri;\r\n> }\r\n> \r\n> v2ray的access.log：内容为空\r\n> v2ray的error.log：\r\n> 2019/06/24 20:11:51 [Debug] v2ray.com/core/app/log: Logger started\r\n> 2019/06/24 20:11:51 [Warning] v2ray.com/core: V2Ray 4.19.1 started\r\n> \r\n> nginx的access.log：\r\n> ************** - - [24/Jun/2019:20:12:50 +0800] \"GET /vms HTTP/1.1\" 301 185 \"-\" \"Go-http-client/1.1\"\r\n> ************** - - [24/Jun/2019:20:12:50 +0800] \"GET /vms HTTP/1.1\" 301 185 \"-\" \"Go-http-client/1.1\"\r\n> ************** - - [24/Jun/2019:20:12:50 +0800] \"GET /vms HTTP/1.1\" 301 185 \"-\" \"Go-http-client/1.1\"\r\n> ************** - - [24/Jun/2019:20:12:51 +0800] \"GET /vms HTTP/1.1\" 301 185 \"-\" \"Go-http-client/1.1\"\r\n> ************** - - [24/Jun/2019:20:12:52 +0800] \"GET /vms HTTP/1.1\" 301 185 \"-\" \"Go-http-client/1.1\"\r\n> ************** - - [24/Jun/2019:20:12:54 +0800] \"GET /vms HTTP/1.1\" 301 185 \"-\" \"Go-http-client/1.1\"\r\n> \r\n> nginx的error.log：空\r\n> \r\n> root@instance-3:/var/log/nginx# iptables -L -n\r\n> Chain INPUT (policy ACCEPT)\r\n> target prot opt source destination\r\n> \r\n> Chain FORWARD (policy ACCEPT)\r\n> target prot opt source destination\r\n> ACCEPT all -- 0.0.0.0/0 0.0.0.0/0\r\n> ACCEPT all -- 0.0.0.0/0 0.0.0.0/0\r\n> \r\n> Chain OUTPUT (policy ACCEPT)\r\n> target prot opt source destination\r\n> \r\n> GCP的防火墙rules：\r\n> <img alt=\"捕获\" width=\"606\" src=\"https://user-images.githubusercontent.com/13503950/60020057-ccc7a000-96c1-11e9-8235-0b58a530423f.PNG\">\r\n\r\nnginx反代tls交给nginx处理，v2不能开tls，请关闭"}}
other: {"actor":{"display_login":"johnrosen1"}}