forked from EvgenyNerush/easy-xray
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate_site4cdn.conf
35 lines (29 loc) · 970 Bytes
/
template_site4cdn.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
server {
# listen ip6 addresses
listen [::]:443 ssl http2 so_keepalive=on;
# your server domain name in CDN, for instance myserver.example.com
server_name server_domain_name;
# fallback: proxy_pass redirects request to another server
location / {
proxy_pass https://www.youtube.com;
}
# path to certificates (self-signed or from Cloudflare)
ssl_certificate /etc/ssl/certs/cert.pem;
ssl_certificate_key /etc/ssl/private/cert.key;
client_header_timeout 52w;
keepalive_timeout 52w;
# secret location; should match that in the xray server config
location /your_service_name {
if ($content_type !~ "application/grpc") {
# redirect to the root location
return 302 /;
}
client_max_body_size 0;
client_body_buffer_size 512k;
grpc_set_header X-Real-IP $remote_addr;
client_body_timeout 52w;
grpc_read_timeout 52w;
# connect to xray on localhost
grpc_pass grpc://127.0.0.1:50051;
}
}