aboutsummaryrefslogtreecommitdiff
path: root/template/nginx/root.conf.template
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2023-05-31 23:55:57 +0800
committercrupest <crupest@outlook.com>2023-05-31 23:55:57 +0800
commit4cc25bea963c09a1eb0f951bed1eabc75d196446 (patch)
tree2f5aa4fe9684a19463255b454162cc84d35ccc2a /template/nginx/root.conf.template
parent4e6260b7d03a38be65203139631d5fda523e80af (diff)
downloadcrupest-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.template17
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 {