-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx-grpc.conf
39 lines (38 loc) · 1 KB
/
nginx-grpc.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
36
37
38
server
{
listen [::]:80 default ipv6only=off;
return 301 https://$http_host$request_uri;
server_tokens off;
access_log /dev/null;
error_log /dev/null;
}
server {
listen unix:/dev/shm/h11.sock;
listen unix:/dev/shm/h2c.sock http2;
server_tokens off;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
location /$(servername){
if ($content_type !~ "application/grpc") {
return 403;
}
client_max_body_size 0;
grpc_read_timeout 1071906480m;
client_body_timeout 1071906480m;
grpc_pass grpc://127.0.0.1:2002;
}
location /$(wspath){
if ($http_upgrade !~ "websocket") {
return 403;
}
proxy_redirect off;
proxy_pass http://localhost:10000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /{
return 403;
}
}