diff options
author | crupest <crupest@outlook.com> | 2023-05-31 23:55:57 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2023-05-31 23:55:57 +0800 |
commit | 4cc25bea963c09a1eb0f951bed1eabc75d196446 (patch) | |
tree | 2f5aa4fe9684a19463255b454162cc84d35ccc2a /template/nginx/root.conf.template | |
parent | 4e6260b7d03a38be65203139631d5fda523e80af (diff) | |
download | crupest-4cc25bea963c09a1eb0f951bed1eabc75d196446.tar.gz crupest-4cc25bea963c09a1eb0f951bed1eabc75d196446.tar.bz2 crupest-4cc25bea963c09a1eb0f951bed1eabc75d196446.zip |
Add v2ray.
Diffstat (limited to 'template/nginx/root.conf.template')
-rw-r--r-- | template/nginx/root.conf.template | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/template/nginx/root.conf.template b/template/nginx/root.conf.template index dfedc81..f148db8 100644 --- a/template/nginx/root.conf.template +++ b/template/nginx/root.conf.template @@ -11,6 +11,22 @@ server { root /srv/www; } + location /_$CRUPEST_V2RAY_PATH { + if ($http_upgrade != "websocket") { + return 404; + } + + proxy_redirect off; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Real-IP $remote_addr; + proxy_pass http://crupest-v2ray:10000; + } + location /api { proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; @@ -21,6 +37,7 @@ server { proxy_set_header X-Real-IP $remote_addr; proxy_pass http://crupest-api; } + } server { |