-
Notifications
You must be signed in to change notification settings - Fork 1
/
server_node.conf
executable file
·47 lines (38 loc) · 1.11 KB
/
server_node.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
39
40
41
42
43
44
45
46
47
#
# Proxy for public API.
#
# Note the other servers also proxy themselves
upstream ws_server {
server localhost:9999;
}
server {
listen 80;
server_name _;
root /var/www/html/;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
keepalive_requests 25000;
# Default location match - will drop all connections
# immediately if websocket location below fails to match.
location / {
return 444;
}
# Matches websocket URL address
location ~ ^/ws$ {
limit_req zone=ws burst=5;
proxy_http_version 1.1;
#proxy_connect_timeout 2;
proxy_pass http://websocket;
proxy_set_header Host $host;
proxy_set_header Connection "upgrade";
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# Allow requests only from the load balancer; IP only, no domain names!
allow www.xxx.yyy.zzz;
deny all;
#proxy_next_upstream error timeout invalid_header http_500;
}
}