-
Notifications
You must be signed in to change notification settings - Fork 1
/
alpn.30443.conf
66 lines (40 loc) · 1.66 KB
/
alpn.30443.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#See: https://superuser.com/questions/1135208/can-nginx-serve-ssh-and-https-at-the-same-time-on-the-same-port
server {
listen 30443;
listen unix:/etc/nginx/socks/alpn.30443.sock;
ssl_preread on;
proxy_pass $ssl_multiplexer;
# proxy_protocol on;
# set_real_ip_from 172.18.0.0/32;
}
map $ssl_preread_alpn_protocols $ssl_multiplexer {
default 127.0.0.1:443; # default to nginx
"h2" unix:/etc/nginx/socks/alpn.h2.sock; #for h2 alpn
"xmpp-server" unix:/etc/nginx/socks/alpn.xmpp.sock; xmpp-server
"h3" unix:/etc/nginx/socks/alpn.h3.sock; #for h3 alpn, I use for ssh
}
# ssl termination for c2s connections
server {
listen unix:/etc/nginx/socks/alpn.h2.sock ssl ;
ssl_certificate /etc/nginx/certs/default.crt;
ssl_certificate_key /etc/nginx/certs/default.key;
proxy_ssl off;
proxy_pass localhost:20001;
}
# ssl termination for s2s connections
server {
listen unix:/etc/nginx/socks/alpn.xmpp.sock ssl ;#proxy_protocol;
# ... <- tls keys and options here
ssl_certificate /etc/nginx/certs/default.crt;
ssl_certificate_key /etc/nginx/certs/default.key;
proxy_ssl off;
proxy_pass localhost:5269;
}
# ssl termination for ssh connections
server {
listen unix:/etc/nginx/socks/alpn.h3.sock ssl ;#proxy_protocol;
ssl_certificate /etc/nginx/certs/default.crt;
ssl_certificate_key /etc/nginx/certs/default.key;
proxy_ssl off;
proxy_pass localhost:22;
}