-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx-proxy-websocket-damon
66 lines (54 loc) · 1.7 KB
/
nginx-proxy-websocket-damon
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
upstream backend {
ip_hash;
server 10.6.5.07:443 max_fails=1;
#server 10.6.1.14:443 max_fails=1;
}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 443;
server_name chat.linuxsogood.org;
ssl on;
ssl_certificate /usr/local/server.pem;
ssl_certificate_key /usr/local/server.key;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_session_cache shared:SSL:10m;
ssl_ciphers HIGH:!aNULL:!MD5;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_hide_header X-Powered-By;
proxy_set_header X-NginX-Proxy true;
proxy_pass https://backend/;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
access_log logs/chat.log;
error_log logs/websockets.error.log;
}
}
upstream backend1 {
server 10.6.6.5:4445;
}
server {
listen 443;
server_name avatar.linuxsogood.org;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_hide_header X-Powered-By;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://backend1/;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
access_log logs/avatar.log;
error_log logs/avatar.error.log;
}
}