mirror of
https://github.com/EvgenyNerush/easy-xray.git
synced 2025-12-13 21:35:03 +03:00
add CDN support at the second ip address
This commit is contained in:
35
template_site4cdn.conf
Normal file
35
template_site4cdn.conf
Normal file
@@ -0,0 +1,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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user